diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2016-07-30 02:29:44 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2016-07-30 02:29:44 +1200 |
commit | bcaaf3210bf644ac7bb5cb05d98b0b17aa258c2c (patch) | |
tree | c988a6c96adf2358db794940f1f1f125fae96201 /bash | |
parent | Add install-bin to default install target (diff) | |
download | dotfiles-bcaaf3210bf644ac7bb5cb05d98b0b17aa258c2c.tar.gz dotfiles-bcaaf3210bf644ac7bb5cb05d98b0b17aa258c2c.zip |
Change cf() from Bash func to shell script
Diffstat (limited to 'bash')
-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" - ) -} |