13. Echo command syntax



This is a tutorial on the echo command in linux with many examples.
It is useful beyond creating text files.

The Linux Command Line Ultimate Tutorial Series: https://www.youtube.com/playlist?list=PLSmXPSsgkZLuJKJhvL1U384aHesbVDekO

################################################

Support on Patreon: https://www.patreon.com/averagelinuxuser

Donate through PayPal: https://www.paypal.me/Kryvokhyzha

################################################

More cool Linux stuff at other social…

4 thoughts on “13. Echo command syntax

  1. Nice examples! 'echo' is a very cool command but, to some extent it is very unintuitive. At 9:27, I did not understand the command 'echo line 1$'n'line 2' at all?! Why all of a sudden single quotes, and not double quotes? With regard to the arithmetic operations, we want an expression like $((2 + 2)) to be interpreted within double quotes but, not within single quotes! So why is it that $'n' is interpreted as a newline but $"n" as n? Also, how shall the user know that 'echo line1$'n'line 2' yields the same as 'echo -e 'line 1nline2' '? In my opinion these kind of peculiarities should be documented in the manual page. But, unfortunately, 'man echo' does not provide more information than 'help echo'.

Leave a Comment

Your email address will not be published. Required fields are marked *