开发者

Linux shell script run multiple shell scripts tabs

开发者 https://www.devze.com 2023-03-29 01:45 出处:网络
I would like to make a .sh that runs multiple other ones .sh in new tabs/windows. something like insi开发者_开发知识库de main.sh

I would like to make a .sh that runs multiple other ones .sh in new tabs/windows.

something like insi开发者_开发知识库de main.sh

"sh1.sh"

wait 5 seconds to load

"sh2.sh"

wait 5 seconds

"sh3.sh"


You could try xterm -e ~/sh1.sh as your command. It'll close as soon as the script has finished though.


If you need to run them in separate windows simultaneously, you need to background each process.

xterm -e sh1.sh &
sleep 5 # why do you want to pause between invocations?
xterm -e sh2.sh &
sleep 5
xterm -e sh3.sh &

This should probably be refactored to use a loop and/or a wrapper function.

for prog in sh1.sh sh2.sh sh3.sh; do
  xterm -e $prog &
  sleep 5
done
0

精彩评论

暂无评论...
验证码 换一张
取 消