有没有更好的方法从makefile中获取设置env变量的脚本?
FLAG ?= 0
ifeq ($(FLAG),0)
export FLAG=1
/bin/myshell -c '<source scripts here> ; $(MAKE) $@'
else
...targets...
endif
Run Code Online (Sandbox Code Playgroud) 我想在处理指定的virtualenv时执行几个操作.
例如命令
make install
Run Code Online (Sandbox Code Playgroud)
相当于
source path/to/virtualenv/bin/activate
pip install -r requirements.txt
Run Code Online (Sandbox Code Playgroud)
可能吗?
我的cron:
45 10 * * * source /home/ThinkCode/Test/hello.sh
Run Code Online (Sandbox Code Playgroud)
hello.sh:
#!/bin/bash
echo "helloworld"
Run Code Online (Sandbox Code Playgroud)
它通过电子邮件向我发送错误:
/bin/sh: source: not found
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?它是配置/环境特定的,所以谷歌搜索没有多大帮助!谢谢..