【发布时间】:2014-10-06 05:38:56
【问题描述】:
我正在创建一个小脚本,我想使用 python 编程语言将一个变量传递给 bash 命令,例如:
number = raw_input("digit: ")
然后我想将 number 变量放入 bash 命令中,例如:
ssh 'foo%s.bar'(number) <- where the %s is located id like it be replaced with the input
最后我想在 python 脚本中的 bash 命令中运行它:
ssh foo45.bar
我怎样才能做到这一点?
【问题讨论】:
标签: python linux bash shell automation