繁体   English   中英

Shell GNU-Screen -X Stuff问题

[英]Shell GNU-Screen -X Stuff problems

OPTIONS="java -Xms1024M -Xmx1024M -jar craftbukkit.jar"
PROCESS=server01

screen -dmS $PROCESS $OPTIONS nogui             # Starting the application
screen -x $PROCESS -X stuff `printf "stop\r"`   # Closing the application
screen -x $PROCESS                              # Attaching to the terminal of the application

应用程序在开始时工作正常,但是我遇到问题stuff 'printf "stop/r"'当我刚刚启动时似乎没有工作,等待一段时间然后尝试使用上面的命令停止它。 但奇怪的是,如果我做了screen -x $PROCESS和detach( ctrl-A & ctrl-D ),然后我使用Stop命令就可以了。 那么有没有办法stuff printf没有screen -x $PROCESS

添加参数-p 0应该修复它。 像这样的东西:

screen -x $PROCESS -p 0 -X stuff `printf "stop\r"`

(从屏幕文档:-p window预选指定的窗口(如果存在)。)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM