Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
cancel
Showing results for 
Search instead for 
Did you mean: 

echo : ksh <==> bash

SOLVED
Go to solution
Werner Ittner
Occasional Advisor

echo : ksh <==> bash

in ksh : echo "HELLO\012\HELLO"
delivers :
HELLO
HELLO

in bash it delivers
HELLO\012HELLO

how can I force bsh to accept \012 as linefeed ?
3 REPLIES
Slawomir Gora
Honored Contributor
Solution

Re: echo : ksh <==> bash

Hi,
for bash add -e option to echo command:

echo -e "HELLO\012HELLO"
Stuart Browne
Honored Contributor

Re: echo : ksh <==> bash

Incidentally, why are you using \012 for a linefeed when \n does it for you?
One long-haired git at your service...
Fred Ruffet
Honored Contributor

Re: echo : ksh <==> bash

And why a "\" before the second H ? :)

Probably a porting issue, isn't it ?

Solution is either -e option (evaluates \ codes) or replacing \012 with \n... \n would be more bash, more linux.

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)