I have some old scripts that I try to update. Some of the code condenses to:
export X=`(echo "abc"; echo "def")`
echo $X
which gives the expected output:
abc def
Now the internet tells me backticks are out $()
is what I need to use, but when I try:
export X=$((echo "abc"; echo "def"))
X
is not set and I get the error:
bash: echo "abc"; echo "def": syntax error: invalid arithmetic operator (error token is ""abc"; echo "def"")
What am I doing wrong?