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
精彩评论