我有一个脚本,我需要他将参数传递给 python 程序。我接受论点:
DAEMON_ARGS=""
start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE --startas $DAEMON \
$DAEMON_ARGS \
|| return 2
其中 $DAEMON 是我的 .py 文件的路径。我需要像这样传递一些数字参数
sudo /etc/init.d/sleepdaemon start 10
我必须将这个数字传递给 sleep.py。sleep.py 的代码:
#! env/bin python
import time
sleep(n)
如何使 n = 10(从控制台传递的参数)?