[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Thanks for the Bash help!
- Subject: [ale] Thanks for the Bash help!
- From: dsj at dsj.net (David S. Jackson)
- Date: Mon, 8 Feb 1999 04:58:07 +0000
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.