是否可以在/ dev / tty1上运行脚本并生成一个程序在/ dev / tty2上运行并等待它完成并运行脚本中的其他命令?例如:
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
答案 0 :(得分:4)
是的,您可以使用openvt
。
openvt -c 2 sh myprogram.sh