2012-08-01 20 views
2

是否可以在/ dev/tty1上運行腳本並生成程序以在/ dev/tty2上運行並等待它完成並運行其他命令劇本?例如:Linux更改爲其他/ dev/ttyX並在那裏運行程序

echo "Hello, this is from terminal 1" 
chvt 2 
sh myprogram.sh (I want it to run on tty2, but it runs on tty1) 
chvt 1 

myprogram.sh:

echo "Hello' this is from terminal 2, please type your input:" 
read A 
exit A 

回答

4

是的,你可以使用openvt做到這一點。

openvt -c 2 sh myprogram.sh 
+0

我得到:'無法獲取涉及控制檯的文件描述符 無法獲取指向控制檯的文件描述符' – 2014-02-24 15:55:12

相關問題