[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to input ^J?

From: John Reiser
Subject: Re: How to input ^J?
Date: Sun, 18 Jul 2010 17:01:05 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20100430 Fedora/3.0.4-2.fc11 Thunderbird/3.0.4

> Lastly since ^J is a newline you can generate one with echo "\n".

That does not work in bash-4.x.  Firstly, by default the bash builtin
'echo' supplies a trailing newline.  Secondly, backslash translation
requires the option "-e".

$ echo "\n"
$ echo "\n" | od -c
0000000   \   n  \n

What does work is either of these:

$ echo '' | od -c
0000000  \n
$ echo -e -n '\n' | od -c
0000000  \n


reply via email to

[Prev in Thread] Current Thread [Next in Thread]