From cc4d682c9c7d0e2361abe3f668ff193ef09e924d Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Tue, 28 Sep 2021 13:12:03 -0700 Subject: [PATCH] remove cdbusiest and rename dbusiest to busiest --- sh/{dbusiest => busiest} | 17 ++++++++--------- sh/cdbusiest | 25 ------------------------- 2 files changed, 8 insertions(+), 34 deletions(-) rename sh/{dbusiest => busiest} (54%) delete mode 100755 sh/cdbusiest diff --git a/sh/dbusiest b/sh/busiest similarity index 54% rename from sh/dbusiest rename to sh/busiest index 0fddc02..1e2ee66 100755 --- a/sh/dbusiest +++ b/sh/busiest @@ -4,16 +4,15 @@ # NO_DASH # NO_ASH -dbusiest() { ### @- - ### list directories ordered descending by the number of files in them, - ### counted recursively. see also [`cdbusiest`.](#cdbusiest) +busiest() { ### @- + ### list directories in descending order by the number of files in them, + ### counted recursively. ### ### ``` - ### $ cd - ### $ dbusiest | head -n3 - ### 152364 src - ### 46518 work - ### 20903 play + ### $ cd && busiest | head -n3 + ### 144181 src + ### 48840 work + ### 21042 play ### ``` [ $# -le 0 ] || { printf "%s\n" "$0: too many arguments" >&2; return 1; } local c d @@ -25,4 +24,4 @@ dbusiest() { ### @- [ -z $d ] && return 1 } -[ -n "${preload+-}" ] || dbusiest "$@" +[ -n "${preload+-}" ] || busiest "$@" diff --git a/sh/cdbusiest b/sh/cdbusiest deleted file mode 100755 index 71fe7e0..0000000 --- a/sh/cdbusiest +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env zsh -# YES_ZSH -# NO_BASH -# NO_DASH -# NO_ASH - -cdbusiest() { ### @- - ### cd to the directory with the most files in it, counted recursively. - ### - ### ``` - ### $ cd - ### $ cdbusiest - ### 152364 src - ### $ pwd - ### /home/notwa/src - ### ``` - dbusiest | read -r c d - [ -z $c ] && return 1 - printf "%s\n" "$c $d" - cd $d -} - -[ -n "${preload+-}" ] || . ~/sh/preload || exit 2 -eval ${preload:-preload} dbusiest -[ -n "${preload+-}" ] || cdbusiest "$@"