bind命令可以将密钥序列绑定到Readline函数或macro.The键序列f5 is \e[15~,我将f5绑定到pkill。
ffplay movie.mp4
bind -x '"\e[15~":"pkill ffplay"'现在按f5,电影就停止播放了。
表达式$(命令)表示命令替换;它意味着运行命令并将其输出放在这里。
echo "it is time to dig '\$(tput kf5)' on $(date)."
it is time to dig '$(tput kf5)' on Sat 07 May 2022 09:50:07 PM HKT.$(tput kf5)显示结果
debian@debian:~$ echo "$(tput kf5)"
debian@debian:~$ echo '$(tput kf5)'
$(tput kf5)没有\e[15~输出here.Why bind -x '"$(tput kf5)":"pkill ffplay"'与bind -x '"\e[15~":"pkill ffplay"'具有相同的效果
发布于 2022-05-07 14:10:45
echo "$(tput kf5)" | cat -A
^[[15~$https://stackoverflow.com/questions/72153177
复制相似问题