Hoi everybody,
I am currently struggling with having to execute multiple commands in an echo. The following line is an example of the problem I am having:
echo (cd .. && pwd)
The idea is, that, when I am currently in the folder "home/Documents", the above code prints "home" - but is still in the directory "home/Documents". However, the above command fails.
The more general question is: How can I execute multiple commands in an echo and print the last result (or all results if its not possible any other way).
Thank you and kind regards.
echois not the right tool. I remember your previous question, you seem to abuseecho. Please see XY problem. What are you really trying to do with this contraption? – Kamil Maciorowski Aug 24 '18 at 10:41echo (cd .. && pwd) bash: syntax error near unexpected token cd'– Fanatique Aug 24 '18 at 10:50echo \pwd``?" is a good start. – Kamil Maciorowski Aug 24 '18 at 11:13echo $(stuff)orecho \stuff``?](https://superuser.com/q/1352850/432690) – Kamil Maciorowski Aug 27 '18 at 21:51