I\'m trying to get quoted parameters of a bash script to safely be received by a nested script. Any ideas?
test.sh
#!/bin/bash
echo $*
bash myecho.sh
#!/bin/bash
echo $*
bash myecho.sh "$@"
Note the "$@" construct is not bash specific and should work with any POSIX shell (it does with dash at least). Note also that given the output you want, you don't need the extra level of quoting at all. I.E. just call the above script like:
./test.sh 1 2 "3 4"