You can use the <( )
replacement for this as it runs a command in a subshell and replaces it with the filename of a temporary fifo. So something like:
join <( echo "${var1}" ) <( echo "${var2}" )
Keep posts about shell scripting! Here are some guidelines to help:
In general, if your submission text is primarily shell code, then it is welcome here!
You can use the <( )
replacement for this as it runs a command in a subshell and replaces it with the filename of a temporary fifo. So something like:
join <( echo "${var1}" ) <( echo "${var2}" )
Perfect, thanks for the explanation. Indeed, I found the same solution via StackOverflow about simultaneously.
The bash
man page is full of useful bits like this, but is is densely packed. It's definitely worth reading though.