How to create a shell script to launch 3 terminals and execute a set of commands in each?

守給你的承諾、 提交于 2019-12-24 11:35:46

问题


Currently, I open 3 terminals ('openocd session','telnet session' & 'gdb session') and execute 'a set of commands' in each terminal every time I flash my image on target.

Is is possible to put this in one shell script file and run at once? (Commands on each terminal are NOT dependent on others; except that the terminals should be opened in the order mentioned above)

Thanks in advance !


回答1:


Which terminal are you using?

A terminal like xterm can start a program instead of a shell. Simply run

xterm -e 'command args ...'

I use this to start my email client:

xterm -e mutt

If you use a different terminal, consult its manual page. I'm pretty sure there's an equivalent for -e.



来源:https://stackoverflow.com/questions/32794967/how-to-create-a-shell-script-to-launch-3-terminals-and-execute-a-set-of-commands

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!