有没有一种方法可以将命令的输出发送到GNU屏幕的复制模式缓冲区。我想输入以下内容:
$ echo 'this is an example' | screen_send_to_copy_mode
或许
C--a Some key
然后,在那之后,当我按下C-]我将得到this is an example
输出。可能吗?
您可以执行以下操作:
screen_send_to_copy_mode() (
tmp=$(mktemp) || exit
cat > "$tmp" &&
screen -X readbuf "$tmp"
ret=$?
(sleep 2; rm -f -- "$tmp")&
exit "$ret"
)
echo 'this is an example' | screen_send_to_copy_mode
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句