[CentOS] bash - safely pass untrusted strings?

Tue Feb 26 23:54:41 UTC 2008
Garrick Staples <garrick at usc.edu>

On Tue, Feb 26, 2008 at 03:30:02PM -0800, Benjamin Smith alleged:
> File script3.sh contains the following: 
> $ cat script3.sh
> #! /bin/sh
> for file in $*
>         do
>         ls -l "$file";
>         done

Use "$@" instead of $*.  It will split up the way you want.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos/attachments/20080226/c339f8e8/attachment-0004.sig>