Linux – How to write non-ASCII characters using echo

asciibashecholinuxnon-ascii-characters

How do I write non-ASCII characters using echo? Is there an escape sequence, such as \012 or something like that?

I want to append ASCII characters to a file using:

echo ?? >> file

Best Solution

If you care about portability, you'll drop echo and use printf(1):

printf '\012'