Reputation: 20609
I have a bash script called foo.sh that in this minimal example looks like this:
#!/bin/bash
time $@
and a python script bar.py:
#!/bin/env python
print sys.argv
I want to do something like
bash foo.sh python bar.py "foo bar"
and want "foo bar" to be apssed as a string to the python skript. However I get either
['bar.py', 'foo', 'bar']
or when I do:
bash foo.sh python bar.py \"foo bar\"
I get:
['bar.py', '"foo', 'bar"']
as output. How do I get "foo bar" to be passed and interpreted as a single string to the python script?
Upvotes: 0
Views: 133