I try to run following command in my terminal:
bash -c 's="test"; s=$(echo "word1 word2 " | awk '{print $1;}'); echo $s;'
It gives me following errors:
bash: -c: line 0: unexpected EOF while looking for matching `)'
bash: -c: line 1: syntax error: unexpected end of file
}); echo $s;: command not found
The problem does not occur when I save my script in a file.