1752778 Members
5916 Online
108789 Solutions
New Discussion юеВ

Re: 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 3
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.)