0
我有一个包装脚本command.sh作为主要的启动脚本为我的Python应用程序,主要是设置一些环境变量,如PYTHONPATH
:参数传递
#!/bin/bash
export PYTHONPATH=lib64/python/side-packages
./command.py $*
command.py看起来是这样的:
#!/usr/bin/python
import sys
print sys.argv
调用包装脚本像
$ ./command.sh a "b c"
结果['./command.py', 'a', 'b', 'c']
,我需要['./command.py', 'a', 'b c']
如何传递包含空格的python脚本参数?
你可能想看看http://stackoverflow.com/questions/9994295/what-does-mean-in-a-shell-script/9995322#9995322了解更多信息。 – Alfe 2013-03-27 14:43:40