siteshen
2014-08-06 23:23:40 +08:00
fabric默认使用bash执行命令,服务器上安装没有bash?
两种解决方案:1. 服务器上安装bash(为什么这个都没有??!!);2. 参考fabric.api.run函数的文档,指定env.shell:
run(command, shell=True, **kwargs)
Run a shell command on a remote host.
If ``shell`` is True (the default), `run` will execute the given command
string via a shell interpreter, the value of which may be controlled by
setting ``env.shell`` (defaulting to something similar to ``/bin/bash -l -c
"<command>"``.) Any double-quote (``"``) or dollar-sign (``$``) characters
in ``command`` will be automatically escaped when ``shell`` is True.