How to parse a variable number of command line arguments with quotes into eval?
问题 I got this simple script: #!/usr/bin/env bash eval "${@:2}" while [ true ] do FocusApp=`xdotool getwindowfocus getwindowname` if [[ "$FocusApp" == *"$1"* ]]; then wmctrl -ir $(xdotool getactivewindow) -b add,maximized_vert,maximized_horz break fi done I run it like this: $ ./maximize.sh "Sublime Text" /usr/bin/subl -n "./My File With Spaces in the Name" But when I run it, Sublime Text tries to open a file named My , another named File , and etc. If I replace the eval "${@:2}" with: eval "\"$2