[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:1.9.1.9) 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"
\n
$ echo "\n" | od -c
0000000 \ n \n
0000003
$
What does work is either of these:
$ echo '' | od -c
0000000 \n
0000001
$ echo -e -n '\n' | od -c
0000000 \n
0000001
$
--