From 548a9c0edf1a0e3bbe20fd988c2b4f3fd8162c1b Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Sat, 7 Sep 2019 01:31:25 +0200 Subject: [PATCH] Add sort for --- bin/launcher.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/launcher.sh b/bin/launcher.sh index 21ca1cd..64c1efd 100755 --- a/bin/launcher.sh +++ b/bin/launcher.sh @@ -12,7 +12,9 @@ FZF_OPTIONS="--layout=reverse --no-extended --print-query --no-sort" # Get shell command list # This may include the occasional non-executable file # command_list=$({ IFS=:; ls -H $PATH; } | grep -v '/.*' | sort -u) -command_list=$(find $(echo $PATH | tr ':' ' ') -type f -executable -printf "\n%f") +command_list=$(\ + find $(echo $PATH | tr ':' ' ') -type f -executable -printf "\n%f" | \ + sort -u) # read existing command history if [ -f "$HIST_FILE" ]; then command_history=$(cat "$HIST_FILE") @@ -31,7 +33,7 @@ if [ "$command_str" = "" ]; then fi # echo "Command: $command_str" -# using \E flag from perl regex +# using \E flag from https://github.com/junegunn/fzfperl regex test "${command_str#*\\E}" != "$command_str" && echo "command can't contain '\E'" test "${command_str#*\\E}" != "$command_str" && exit 1