How To Preserve Quotes In Bash Arguments

If you want to preserve quoting to pass shell arguments to a called command, use the four characters “$@” (including the double quotes) instead of the two characters $*
![]() |
If you want to preserve quoting to pass shell arguments to a called command, use the four characters “$@” (including the double quotes) instead of the two characters $*
When using Perl’s exec() call, the best way to invoke it is as follows:
1 |
exec("$dir/myprog.sh",@ARGV); |
This syntax does some important things: – passes a scalar value as the first argument which exec interprets as PROGRAM – passes an array as the second argument which exec will use as the arguments to pass into PROGRAM Note […]