fzfmenu-run: POSIX executable listing

This commit is contained in:
yosh 2023-07-06 21:11:21 -05:00
parent d2368de881
commit e929c6fe7d
1 changed files with 1 additions and 2 deletions

View File

@ -1,8 +1,7 @@
#!/bin/sh
set -euf
# GNU find only
cmd="$(IFS=':'; find $PATH \( -type f -o -type l \) -printf '%f\n' | sort | uniq | fzfmenu --layout reverse --prompt 'run > ' "$@")"
cmd="$(IFS=':'; find $PATH \( -type f -o -type l \) | awk -F '/' '{print $NF}' | sort | uniq | fzfmenu --layout reverse --prompt 'run > ' "$@")"
# this menu will act as if you typed the command in a shell, hence eval and -e sh -c
# this runs in userspace, so no eval security risk should be present