Why `bind -x '"$(tput kf5)":"pkill ffplay"'` take as same effect as `bind -x '"\e[15~":"pkill ffplay"'`?

51 Views Asked by At

bind command can bind a key sequence to a Readline function or a macro.The key sequence of f5 is \e[15~,i bind f5 with pkill.

ffplay  movie.mp4
bind -x '"\e[15~":"pkill ffplay"'

Now press f5, the movie stop playing.

The expression $(command) stands for command substitution; it means run command and put its output here.

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.

Show result of $(tput kf5):

debian@debian:~$  echo "$(tput kf5)"

debian@debian:~$  echo '$(tput kf5)'
$(tput kf5)

No \e[15~ output here.Why bind -x '"$(tput kf5)":"pkill ffplay"' take as same effect as bind -x '"\e[15~":"pkill ffplay"'?

1

There are 1 best solutions below

1
On
echo "$(tput kf5)" | cat -A
^[[15~$