我正在浏览this shell脚本,无法理解那里使用的'screen_it'命令。任何帮助表示赞赏
答案 0 :(得分:1)
这是一个函数,在第109行定义:
function screen_it {
screen -S nova -X screen -t $1
screen -S nova -p $1 -X stuff "$2$NL"
}
从屏幕上manual引用
stuff string
将字符串字符串填入当前窗口的输入缓冲区。这就像“粘贴”命令,但开销要少得多。您无法使用“stuff”命令粘贴大缓冲区。它对键绑定最有用。另见“bindkey”。
因此,根据该描述,stuff "$2$NL"
将“粘贴”第二个参数并添加换行符。
答案 1 :(得分:0)
screen_it
是第109行定义的函数
https://github.com/vishvananda/novascript/blob/master/nova.sh#LID109