fai-cd: quotes around command for -x test

michael log mmlogin at gmail.com
Wed Oct 13 17:37:10 CEST 2010


Hello,

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

-- 
Regards,
Michael


More information about the linux-fai-devel mailing list