:
# @(#) l-z.sh 1.1 94/06/21
# 92/09/05 john@armory.com
# 92/11/05 added ability to read filenames from stdin
# 93/12/09 Use xargs for command line args too; since this isn't a #!
#          script sh/ksh can pass long arg lists
# 94/06/21 Added help.

if [ "$1" = -h ]; then
    echo \
"$0: list files sorted by file size, smallest first.
Usage: $0 [filename ...]
If no filenames are given, the files in the current directory are listed.
If a filename of - is given, filenames are read from the standard input."
    exit 0
fi

if [ "$1" = - -a $# -eq 1 ]; then
    xargs l
else
    for arg; do
	echo "$arg"
    done | xargs l
fi | sort +4 -5 -n
