mirror of
https://github.com/simonmichael/hledger.git
synced 2024-09-16 00:37:33 +03:00
scripts: bin: exclude non-executable files
This commit is contained in:
parent
d84f2b4eb8
commit
5e735b4faf
@ -15,10 +15,12 @@ bin() { # bin [PAT] - list aliases, functions, scripts in ./bin/[bashrc]
|
||||
| gnused -E -e 's/^alias *//' -e 's/^(function )?(\w+) *\(\) *\{/\2()/' -e 's/#/\t#/' \
|
||||
# -e "s/=('[^']+'|\"[^\"]+\"|\w+)/=/" # uncomment to hide alias definitions
|
||||
[[ -d $BINDIR ]] && for F in "$BINDIR"/*; do
|
||||
[[ -x $F ]] || continue
|
||||
printf '%s ' "$(basename "$F")"
|
||||
(grep -IE '^(#|--) ' "$F" 2>/dev/null | gnused -E 's/(#|--)/\t#/'; echo) | head -1
|
||||
done
|
||||
) | grep -iE "$PAT" # | sort -b -k2
|
||||
) | grep -iE "$PAT" \
|
||||
#| sort -b -k2 # uncomment to sort by name
|
||||
}
|
||||
|
||||
gnused() { # GNU sed, called gsed on mac
|
||||
|
Loading…
Reference in New Issue
Block a user