Tag Archives: function

GNU readline + bind + functions + keybinding

knowledge representation

$ 4.2.29 57 557---> bind -P 

abort can be found on "\C-g", "\C-x\C-g", "\e\C-g".
accept-line can be found on "\C-j", "\C-m".
alias-expand-line is not bound to any keys
arrow-key-prefix is not bound to any keys
backward-byte is not bound to any keys
backward-char can be found on "\C-b", "\eOD", "\e[D".
backward-delete-char can be found on "\C-h", "\C-?".
backward-kill-line can be found on "\C-x\C-?".
backward-kill-word can be found on "\e\C-h", "\e\C-?".
backward-word can be found on "\e\e[D", "\e[1;5D", "\e[5D", "\eb".
beginning-of-history can be found on "\e<".
beginning-of-line can be found on "\C-a", "\eOH", "\e[1~", "\e[H".
call-last-kbd-macro can be found on "\C-xe".
capitalize-word can be found on "\ec".
.
.
.
.
.
.
.
.
.
yank-last-arg can be found on "\e.", "\e_".
yank-nth-arg can be found on "\e\C-y".
yank-pop can be found on "\ey".

function implementation for bash shell

knowledge representation

$ 4.2.20 44 301---> cat .bashrc 
#export PS1="\[\033[0;31m\] $ \V \# \! "
export PS1="$ \V \# \!---> "

shellp()
{
pre=: post=:
printf "$pr%s$po\n" "$@"
}

$ 4.2.20 45 302---> shellp hacker cracker maker 
hacker
cracker
maker
$ 4.2.20 46 303---> 

$ 4.2.20 2 457---> cat .bashrc 
#export PS1="\[\033[0;31m\] $ \V \# \! "
export PS1="$ \V \# \!---> "

shellp()
{
pre=: post=:
printf "$pre%s$post\n" "$@"
}

$ 4.2.20 3 458---> shellp hacker cracker maker
hacker
cracker
maker
$ 4.2.20 4 459---> source .bashrc 
$ 4.2.20 5 460---> shellp hacker cracker maker
:hacker:
:cracker:
:maker:
$ 4.2.20 6 461--->