【发布时间】:2014-05-28 08:05:25
【问题描述】:
我写了一个循环中包含python命令的bash:(脚本的一部分)
#!/bin/bash
ARG=( $(echo "${@:3}"))
for (( i=1; i<=$#-3; i++ ))
do
python -c "print('<Command with variables>' * 1)"
done
当我运行它时,取决于我的参数数量,例如我有这个输出:
nohup command-a &
nohup command-b &
nohup command-c &
如何立即执行 bash 的输出行?
我可以告诉 python 命令在每次迭代中运行它们吗?怎么样?
谢谢
【问题讨论】:
标签: python arrays bash eval execution