Florian Zieboll via Dng wrote: > Dear list,
> this im my 'test.sh':
> for f in "$@" ; do
> xcmd="unrar x"
> $xcmd "$f"
> Can please somebody explain, why, if I double-quote the "$xcmd"
> variable in line 4, the script fails with
> ./test.sh: line 4: unrar x: command not found
> Commands without parameters resp. whitespace (e.g. xcmd="unzip") work
> fine when double-quoted; a web search (including the "GNU Bash manual"
> ) did not shed any light on this mystery...
> Thank you and libre Grüße,
>  https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html > _______________________________________________
> Dng mailing list
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng I believe quoting $xcmd would instruct the shell to look for and execute
"unrar x" so unless you have an executable file named unrar\ x within
$PATH, it will fail. The same thing happens within a shell:
~$ "unrar x"
bash: unrar x: command not found
This message was posted to the following mailing lists: