I have a script that logs the user argument list. This list is later processed by getopt
.
If the script is started like:
./script.sh -a 'this is a sentence' -b 1
... and then I save "$@"
, I get:
-a this is a sentence -b 1
... without the single quotes. I think (because of the way Bash treats quotes) these are removed and are not available to the script.
For logging accuracy, I'd like to include the quotes too.
Can the original argument list be obtained without needing to quote-the-quotes?