On 03-Apr-07 14:52:07, Chris G wrote:
No, no, no, no, no - oh dear, I've confused myself haven't I. The echo man page is quite correct and (as others have noted) all that's happening above is that echo is turning the \n into a newline.
However I now think I can get what I want and show it:-
chrisg$ fred="abcde"$'\n'"ghijk" chrisg$ echo $fred abcde ghijk chrisg$
The sequence $'\n' in bash is a string containing a single newline character (most of the other familiar \ specials work too).
Hmmm ... Trying the above:
fred="abcde"$'\n'"ghijk" echo $fred abcde ghijk
echo "$fred" abcde ghijk
I wonder why ... ?? At least, the $'\n' is a smooth way to get the newline into $fred!
Ted.
-------------------------------------------------------------------- E-Mail: (Ted Harding) ted.harding@nessie.mcc.ac.uk Fax-to-email: +44 (0)870 094 0861 Date: 03-Apr-07 Time: 16:10:44 ------------------------------ XFMail ------------------------------