Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 27-04-2022 9:05 Linux terminal help
- Simple terminal help for easier use of commands.
- 1. exec
- # cmd=$(cat ~/help.txt | fzf) && history -s $cmd && echo $cmd && echo $cmd > ~/help.tmp && . ~/help.tmp
- # cmd=$(cat ~/help.txt | fzf) && history -s $cmd && echo $cmd | tee ~/help.tmp && . ~/help.tmp
- # cmd=$(cat ~/help.txt | fzf) && history -s $cmd && echo $cmd && eval $cmd
- cmd=$(< ~/help.txt fzf) && history -s $cmd && echo $cmd && eval $cmd
- source : https://porkmail.org/era/unix/award#uucaletter
- 2. edit
- # cmd=$(cat ~/help.txt | fzf) && read -p "read > " -e -i "$cmd" && history -s $REPLY && echo $REPLY > ~/help.tmp && . ~/help.tmp
- # read -p "read > " -e -i "$(cat ~/help.txt | fzf)" && history -s $REPLY && echo $REPLY > ~/help.tmp && . ~/help.tmp
- # read -p "read > " -e -i "$(cat ~/help.txt | fzf)" && history -s $REPLY && eval $REPLY
- read -p "readline > " -ei "$(< ~/help.txt fzf)" && history -s $REPLY && eval $REPLY
- 1. exec
- # Not working if ignoredups active :
- # cmd=$(cat ~/help.txt | fzf) && history -s $cmd && history -s $cmd && fc -s && history -d $(history 1)
- history -s $(< ~/help.txt fzf) && history -s x && fc -s
- 2. edit
- # cmd=$(cat ~/help.txt | fzf) && read -p "read > " -e -i "$cmd" && history -s $REPLY && history -s $REPLY && fc -s && history -d $(history 1)
- # read -p "read > " -e -i "$(cat ~/help.txt | fzf)" && history -s $REPLY && history -s $REPLY && fc -s && history -d $(history 1)
- read -p "readline > " -ei "$(< ~/help.txt fzf)" && history -s $REPLY && history -s x && fc -s
- More :
- edit:
- xdotool type "$(cat ~/help.txt | fzf)"
- xdotool type "$(cat ~/help.txt | fzf)" && echo
- stty -echo && xdotool type --delay 0 "$(cat ~/help.txt | fzf)" && stty echo
- exec:
- stty -echo && xdotool type --delay 0 "$(cat ~/help.txt | fzf)$(printf "\n\b")" && stty echo
- stty -echo && xdotool type --delay 0 "$(printf "$(cat ~/help.txt | fzf)\r\r")" && stty echo
- source:
- https://stackoverflow.com/questions/31846572/why-does-xdotool-type-twice-how-can-i-avoid-it
- Not perfect:
- command $(cat ~/help.txt | fzf)
- echo | $(cat ~/help.txt | fzf)
- echo -ne "\n" | $(cat ~/help.txt | fzf)
- fzf settings : fzf --tac --bind=left-click:accept --no-color --pointer='+' --cycle --exact
- interactive filters:
- https://lobste.rs/s/squpog/interactive_filter_new_standard_tool
- + skim:
- https://github.com/lotabout/skim
- ############################################################################################################################
- ############################################################################################################################
- 04-03-2022 9:05 Linux terminal help
- 1. exec
- cmd=$(cat ~/help.txt | fzf) && history -s $cmd && echo $cmd | tee ~/help.tmp && . ~/help.tmp
- 2. edit
- # cmd=$(cat ~/help.txt | fzf) && read -p "read > " -e -i "$cmd" && history -s $REPLY && echo $REPLY > ~/help.tmp && . ~/help.tmp
- read -p "read > " -e -i "$(cat ~/help.txt | fzf)" && history -s $REPLY && echo $REPLY > ~/help.tmp && . ~/help.tmp
- Not working if ignoredups active.
- 1. exec
- cmd=$(cat ~/help.txt | fzf) && history -s $cmd && history -s $cmd && fc -s && history -d $(history 1)
- 2. edit
- # cmd=$(cat ~/help.txt | fzf) && read -p "read > " -e -i "$cmd" && history -s $REPLY && history -s $REPLY && fc -s && history -d $(history 1)
- read -p "read > " -e -i "$(cat ~/help.txt | fzf)" && history -s $REPLY && history -s $REPLY && fc -s && history -d $(history 1)
- More :
- edit:
- xdotool type "$(cat ~/help.txt | fzf)"
- xdotool type "$(cat ~/help.txt | fzf)" && echo
- stty -echo && xdotool type --delay 0 "$(cat ~/help.txt | fzf)" && stty echo
- exec:
- stty -echo && xdotool type --delay 0 "$(cat ~/help.txt | fzf)$(printf "\n\b")" && stty echo
- stty -echo && xdotool type --delay 0 "$(printf "$(cat ~/help.txt | fzf)\r\r")" && stty echo
- Not perfect:
- command $(cat ~/help.txt | fzf)
- echo | $(cat ~/help.txt | fzf)
- fzf settings : fzf --tac --bind=left-click:accept --no-color --pointer='+' --cycle --exact
Advertisement
Add Comment
Please, Sign In to add comment