#!/bin/bashdir=$1if [ -z "$dir" ] ; then dir=`pwd`ficount=0for file in `ls "$dir"`; do if [ -f "$file" ] ; then count=$[$count+1] fidoneecho $count
if [ $# -eq 0 ]thennowdir=`dir`elsenowdir=$1fiecho $nowdir