我尝试编写自己的 shell 脚本。目前为止,我已经成功打开了 4 个 xterminals,但由于“hold”选项的限制,它们只能执行一个命令。
如果我不使用这个选项,终端窗口就会消失。
以下是我的代码:
#!/bin/sh
xterm -title "App 1" -hold -e mycommand | mysecondcommand &
xterm -title "App 2" -hold -e mycommand | mysecondcommand &
xterm -title "App 3" -hold -e mycommand | mysecondcommand &
xterm -title "App 4" -hold -e mycommand | mysecondcommand
我不确定是否应该在同一个终端执行第二个命令。
有什么想法吗?
谢谢
xterm -title "App 1" -e "cd /my/dir && mycommand"
,会发生什么? - Josh Jollyxterm -title "App 1" -e cd /home/
- itachi42xterm -title "App 1" -e "touch testfile"
的命令,那么testfile
是否会被创建? - Josh Jolly