diff options
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r-- | bash/bashrc.d/cf.bash | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/bash/bashrc.d/cf.bash b/bash/bashrc.d/cf.bash deleted file mode 100644 index 50308fa3..00000000 --- a/bash/bashrc.d/cf.bash +++ /dev/null @@ -1,29 +0,0 @@ -# Count files -cf() { - local dirname - - # Specify directory to check - dirname=${1:-"$PWD"} - - # Error conditions - if [[ ! -e $dirname ]] ; then - printf 'bash: %s: %s does not exist\n' \ - "$FUNCNAME" "$dirname" >&2 - return 1 - elif [[ ! -d $dirname ]] ; then - printf 'bash: %s: %s is not a directory\n' \ - "$FUNCNAME" "$dirname" >&2 - return 1 - elif [[ ! -r $dirname ]] ; then - printf 'bash: %s: %s is not readable\n' \ - "$FUNCNAME" "$dirname" >&2 - return 1 - fi - - # Count files and print; use a subshell so options are unaffected - ( - shopt -s dotglob nullglob - declare -a files=("$dirname"/*) - printf '%u\t%s\n' "${#files[@]}" "$dirname" - ) -} |