모든 args를 포함하는 bash 변수를 생성하고 args에 공백이 포함됩니다. 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"
, 내가 에 대한 몇 가지 "해당 파일"오류가, 이
http://stackoverflow.com/questions/2005192/how-to-execute-a-bash-command-stored-as-a-string-with -quotes-and-asterisk –