Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.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,尝试在远程bash服务器上运行tsch命令_Python_Unix_Fabric - Fatal编程技术网

在Python中使用Fabric,尝试在远程bash服务器上运行tsch命令

在Python中使用Fabric,尝试在远程bash服务器上运行tsch命令,python,unix,fabric,Python,Unix,Fabric,抱歉,这个标题让人困惑。我使用Fabric在本地网络上运行远程python脚本: #Path to file being run env.source = 'c/yadda/yadda' env.file = 'run_tests.py' env.set = 'source ~USERNAME/ENVIRONMENT' #create the task of changing the directory and running the test file from there def link

抱歉,这个标题让人困惑。我使用Fabric在本地网络上运行远程python脚本:

#Path to file being run
env.source = 'c/yadda/yadda'
env.file = 'run_tests.py'
env.set = 'source ~USERNAME/ENVIRONMENT'

#create the task of changing the directory and running the test file from there
def link():
    print('Connecting to remote computer and setting envirnoment...')
    run ('%s' % env.set)
    run ('cd %s && ./%s' % (env.source, env.file))


--- The env.set is used to bring the Python version up to a more recent version so that the file commands work (open with was causing problems).

问题是env.set有tsch命令,比如setenv,在bashshell中运行时会出现错误。有没有什么方法可以编写上面的代码来合并tsch命令?

不管我自己怎么解决:)

在顶部设置:

env.shell = '/bin/rbash -l -c' 

我绕过了这个环境问题。

但我自己解决了:)

在顶部设置:

env.shell = '/bin/rbash -l -c' 
我绕过了环境问题