diff options
Diffstat (limited to '')
| -rw-r--r-- | functions/sourceall | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/functions/sourceall b/functions/sourceall new file mode 100644 index 0000000..b63c58b --- /dev/null +++ b/functions/sourceall @@ -0,0 +1,16 @@ +#!/bin/zsh +local ext= +local f= +local p= + +# calling `sourceall zsh` will source *.zsh, otherwise * +(( $# > 0 )) && ext=".$1" + +for p in $apath +do + [[ -d $p ]] || continue + for f in $p/*$ext(.N) + do + [[ -r $f ]] && . $f + done +done |
