demofun(){ for file in `ls $1` do if test -f $file then echo "file: $file" elif test -d $file then echo "path: $file" fi done } path="/home/lwang/Desktop/wujuan" demofun $path
demofun(){ for file in `ls $1` do if test -f $file then echo "file: $file" elif test -d $file then echo "path: $file" fi done } path="/home/lwang/Desktop/wujuan" demofun $path