[ale] Thanks for the Bash help!

David S. Jackson dsj at dsj.net
Sun Feb 7 23:58:07 EST 1999


Thanks to everyone for the BASH help!  

Here were the ways to list ONLY directories in a current or a non-current
directory:

current directory only:   ls -d */

any directory:  find $dirname d -maxdepth 1 -ls   (where $dirname is current
or non-current directory)

from a function:

lsd() {
curdir=${1:-$PWD}

for dirname in $(ls $curdir)
  do
    if [ -d $curdir/$dirname ]; then echo -ne "$dirname\t" fi
  done
echo -e "\n"            
}

Thanks!  As usual you all are GREAT!  :-)

--
David S. Jackson                           http://www.dsj.net
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Would you buy a car with the hood welded shut?
Linux: the maintainable OS.






More information about the Ale mailing list