私のすべてのargsを含むbash変数を生成し、それらのargsにはスペースが含まれています。 これらの引数を使ってコマンドを起動すると - たとえば。 ls $ args - 引用符は正しく解釈されません。 ここでは、必要なファイルの作成と消去の例を示します。それとbash - 複数のargsを引用符で囲んでいる変数
#!/bin/bash
f1="file n1"
f2="file n2"
# create files
touch "$f1" "$f2"
# concatenate arguments
args="\"$f1\" \"$f2\""
# Print arguments, then launch 'ls' command
echo "arguments :" $args
ls $args
# delete files
rm "$f1" "$f2"
、私は "ファイル、 N1"、 "ファイルと N2" あなたはarray用を使用して検討するかもしれない
http://stackoverflow.com/questions/2005192/how-to-execute-a-bash-command-stored-as-a-string-with -quotes-and-asterisk –