fai-cd: quotes around command for -x test
Michael Prokop
mika at grml.org
Thu Oct 14 17:09:28 CEST 2010
* michael log <mmlogin at gmail.com> [Wed Oct 13, 2010 at 06:37:10PM +0300]:
> There should be quotes around the $(command) for the -x test shell
> builtin: [ -x "$(command)" ]
> This is owing to the following:
> debian:~# which rsync
> /usr/bin/rsync
> debian:~# which rsync_x
> debian:~# [ -x "$(which rsync)" ] && echo ok
> ok
> debian:~# [ -x "$(which rsync_x)" ] && echo ok
> debian:~# [ -x $(which rsync) ] && echo ok
> ok
> debian:~# [ -x $(which rsync_x) ] && echo ok
> ok
> debian:~#
> Index: bin/fai-cd
> ===================================================================
> --- bin/fai-cd (revision 6123)
> +++ bin/fai-cd (working copy)
> @@ -331,7 +331,7 @@
> # main program
> rsync=0
> -[ -x $(which rsync) ] && rsync=1
> +[ -x "$(which rsync)" ] && rsync=1
> # Parse commandline options
> while getopts "nkfhHg:bBG:m:C:u:" opt ; do
Thanks, I've commited:
-[ -x $(which rsync) ] && rsync=1
+if [ -x "$(which rsync)" ] ; then rsync=1 ; fi
in svn trunk r6127 (giving proper credits to you of course).
regards,
-mika-
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
Url : http://lists.uni-koeln.de/pipermail/linux-fai-devel/attachments/20101014/5d8b2da7/attachment.bin
More information about the linux-fai-devel
mailing list