Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何使Fabric使用默认shell的bash shell insread?_Python_Python 3.x_Bash_Ssh_Fabric - Fatal编程技术网

Python 如何使Fabric使用默认shell的bash shell insread?

Python 如何使Fabric使用默认shell的bash shell insread?,python,python-3.x,bash,ssh,fabric,Python,Python 3.x,Bash,Ssh,Fabric,我正在尝试使用织物(蟒蛇3)。我的删除服务器使用“ksh”shell,但我需要使用“bash”shell。如何使用Fabric实现这一点?我使用名为Fabric\u RUN\u SHELL的环境变量来实现这一点。例如: export FABRIC_RUN_SHELL=/usr/bin/bash 您也可以直接在fabfile.py中配置它: @task def my_task(c): pass @task def my_task2(c): pass ns = Collecti

我正在尝试使用织物(蟒蛇3)。我的删除服务器使用“ksh”shell,但我需要使用“bash”shell。如何使用Fabric实现这一点?

我使用名为
Fabric\u RUN\u SHELL的环境变量来实现这一点。例如:

export FABRIC_RUN_SHELL=/usr/bin/bash
您也可以直接在fabfile.py中配置它:

@task
def my_task(c):
    pass

@task
def my_task2(c):
    pass

ns = Collection(my_task)
ns.configure({'run': {'shell': '/usr/bin/bash'}})
还有其他选项,例如从配置文件加载。令人困惑的是,所有细节都在文档中,而不是结构文档中。中提到了使用
FABRIC\uu
前缀而不是
INVOKE\uu
前缀的事实