bug-gnu-utils
[Top][All Lists]
Advanced

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

echo \\n bonus whitespace


From: Dan Jacobson
Subject: echo \\n bonus whitespace
Date: 06 Jan 2002 11:54:02 +0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

It just doesn't feel right:
$ echo -e H \\n q
H 
 q

I say it should make
H
q

$ echo -e H \\n\ q
H 
 q
at least that works as expected.

anyway, after IFS splitting, echo apparently gives you a gift of a
space after a newline, unless it detects another character immediately
following, or no arguments following.

$ echo --version
--version
oh great. then it is bash... but wait:
$ /bin/echo -e H \\n q
H 
 q
$ /bin/echo --version
echo (GNU sh-utils) 2.0
Written by FIXME unknown.

/bin/echo -e \\n \\n \\n|od -c
0000000  \n      \n      \n  \n
0000006

I probably discovered a well known shameful kludge that dare not be
fixed lest it break something else.
-- 
http://www.geocities.com/jidanni/ Tel+886-4-25854780



reply via email to

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