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

Re: Bug in bash

On Fri, Sep 28, 2001 at 06:05:00PM -0400, Bruce Jackson wrote:
> If I do the following:  echo "bob\n" the output is:
> bob\n
> I tried this on HP-UX and Solaris and the output is:
> bob
> The newline is added.  None of the Backslash escape sequence work (ie \a 
> \b \t etc).  It works fine with pdksh and csh.  I am not sure where the 
> bug is coming from.

The best way to do this, AFAIK, is to avoid using echo for all
non-trivial output and use printf(1) instead, which does escaping
and other printf(3)-based formatting. Its advantage is that it is
portable, unlike echo which is a portability nightmare.

By the way, this has nothing to do with Linux, as both bash and 
fileutils are GNU programs.

Reply to: