On Sun, Apr 26, 2020 at 01:04:05PM +0200, Otto Moerbeek wrote:

> On Sun, Apr 26, 2020 at 12:27:24PM +0200, Thomas de Grivel wrote:
> 
> > Hello,
> > 
> > I was testing some scripting using /bin/sh and I could not find this
> > behaviour in the documentation :
> > 
> > > $ /bin/sh
> > > $ echo -n '\n'
> > >
> > > $
> > 
> > It seems that ksh even in sh (posix ?) mode does expansion of \n to an
> > actual newline.
> 
> Nope, this is a property of the builtin 'echo'. echo (and the more
> general print) are described in the Command execution section of
> ksh(1).
> 
> > 
> > First is there a way to turn off the \n expansion in simple quotes in 
> > /bin/sh ?
> 
> Not with echo, but print has -r

Oops, echo has -E of course

> 
>       -Otto
> > 
> > Second I don't see this feature described neither in man sh nor man
> > ksh so is it a known behaviour of ksh ?
> > 
> > Thanks a ton,
> > 
> > -- 
> >  Thomas de Grivel
> >  kmx.io
> > 

Reply via email to