views:

1641

answers:

4

Is there an escape sequence, such as \012 or something like that?

I want to append on ascii chars to a file using echo ?? >> file

+7  A: 

Use

echo -e "\012"
vartec
+2  A: 

Duplicate of this question.

DNS
Well, not exactly, this 7-bit ASCII control code '\n', not unicode.
vartec
A: 

In the DOS command line enter EDIT, then to insert control characters use CTRL+P followed by the control character required.

For example

echo Ctrl-P ALT+013 > file
Cheesy
+4  A: 

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

printf '\012'
Cirno de Bergerac