Reputation: 780
I have written the following command substitution and executed in in a bash shell:
$(echo echo 1; echo 2; echo 3) #output: 1 2 3
Why is the double echo
required in the first expression, while only single echo
s are required in the second and third?
Upvotes: 0
Views: 15
Reputation: 17620
It has to do with what you've actually asked the shell to do. That is as follows:
"Echo the result of echo 1; echo 2; echo 3"
Upvotes: 1