commit 749e305d3671368a8d08de002f5235298ed1ed53

Denys Vlasenko vda.linux at googlemail.com
Thu Nov 25 05:55:06 UTC 2010


On Thursday 25 November 2010 00:24, Ralf Friedl wrote:
> 
> > +               # need to use printf: different shells have inconsistent
> > +               # rules re handling of "\n" in their params,
> >   
> Which shells have inconsistent handling? All shells that I have access 
> to at the moment (ash, bash, sash, tcsh, zsh and busybox ash) print 
> their params as is:
> printf %s "\n" -> \n
> Also, all of these shells convert \n in the format string to newline.

Does this look better?

                # Need to use printf: different shells have inconsistent
                # rules re handling of "\n" in echo params,
                # and ${insert} definitely contains "\n".
                # Therefore, echo "${header}" would not work:
                printf "%s\n" "${header}"


-- 
vda


More information about the busybox mailing list