我正在尝试用sarge库执行shell脚本。
我的文件script.sh
包含以下内容:
#!/usr/bin/env sh
export LOCAL_PROJECT_ROOT=/path/to/the/dir
inotifywait -mr --exclude '(.git|.idea|node_modules)' \
-e modify,create,delete ${LOCAL_PROJECT_ROOT} --format '%w%f'
我像中士一样管理它:
sarge.run('sh script.sh')
我看到htop
没有运行inotifywait
进程。
但是,当我在shell中直接用sh script.sh
运行这个脚本时,一切都按预期工作。你知道吗
如果我删除--exclude
和--format
两个都包含引用参数的部分,sarge也可以运行。你知道吗
如果我把剧本改写成这样的话,中士也会觉得不错的:
echo "inotifywait -mr --exclude '(.git|.idea|node_modules)' -e modify,create,delete ${LOCAL_PROJECT_ROOT} --format '%w%f'" | /bin/sh
听起来像是模块问题。你知道吗
因为:
也许:
\n
,但您得到了“\\n”inotifywait -mr exclude '(.git|.idea|node_modules)'
这对壳牌来说还不够。你知道吗相关问题 更多 >
编程相关推荐