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

Bug#490605: debian-policy: please discourage the usage of echo -n, and echo in general



On Thu, Jun 04, 2009 at 11:53:19AM +0200, Raphael Hertzog wrote:
> On Thu, 04 Jun 2009, Giacomo Catenazzi wrote:
> > It is not an alternative:
> > - It is ugly
> > - it is not on root partition
> > 
> > The ugly part it is IMHO the most important part.
> 
> Ugliness is relative. I have no problem with printf.

Consider this example: the safe "printf" way to do
echo $BAR
is
printf "%s\n" "$BAR"

(in case BAR hold a value like BAR="%s a")
So printf is slightly unwiedly to use and it can create
format string attack.

> For the second argument:
> 
> [ using bash ]
> $ type printf
> printf is a shell builtin
> $ dash
> $ type printf
> printf is a shell builtin
> 
> There's no external executable needed.

Are all these shell builtin compatible with /usr/bin/printf ?

Cheers,
-- 
Bill. <ballombe@debian.org>

Imagine a large red swirl here. 



Reply to: