The following question is a variation of my problem:
Bash: Reading quoted/escaped arguments correctly from a string
I want to write a bash script (say 'something.sh') of the following kind ...
#!/bin/bash
python $*
... which passes all command line arguments as they were given to it directly to the child process. The above based on $* works for commands like ...
./something.sh --version
... just fine. However, it fails miserably for string arguments like for instance in this case ...
./something.sh -c "import os; print(os.name)"
... which results (in my example) in ...
python -c import
... cutting the string argument at the first space (naturally producing a Python syntax error).
I am looking for a generic solution, which can handle multiple arguments and string arguments for arbitrary programs called by the bash script.