我有一个脚本,输入2 -> file#.txt ->换行符到我的程序。但是,即使循环运行了10次,脚本也只将file4.txt输入到我的程序中。我不确定为什么这是专门针对i=4的。gnome-terminal --working-directory=/path/to/dir/ -- bash -c "{ for i in {1..10};
do echo "2"; echo/program; exec bash</em
我有一个bash脚本做了很多叫做script.sh的事情:#It#Doing有什么方法可以让我从内部获取这个脚本的进程ID,然后在5分钟后杀死它吗?#!/bin/bash
#Get pid of script.sh here, start a 5 minute timer and kill the script after time runs out