#!/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 "$@"