Bel*_*ndu 3 command-line bash terminal shell-script
这是我的 Port.sh 文件
echo 'Give me a maximum of 5 seconds to run please.'
lsof -i | grep Xvnc | grep ESTABLISHED | grep $USER
lsof -i | grep $USER | grep Xvnc | grep -o -P '(?<=:).*(?=->)'
echo 'Brought to you by a cloudy and unlucky day.'
echo 'Press enter to exit'
Run Code Online (Sandbox Code Playgroud)
我想让终端在关闭前的最后一个回声之后等待用户按回车键。
脚本完成后,我的 ubuntu 桌面环境中的所有用户都将终端设置为关闭。
谁能告诉我我能做些什么来让终端等待用户按下回车键。
我用谷歌搜索过,没有任何相关的东西出现。
在脚本末尾添加:
read junk
Run Code Online (Sandbox Code Playgroud)
有关更多信息,请参阅Bash 手册。