Simple Shell Scripting

  1. The problem statement, all variables and given/known data:

An argument example:
../path/cse/lab3/remove

Right now, it's printing out all the directory and files in 'lab3'.
I want it to print out all the files in 'remove'.
I'm not sure how to do that. (I want to use a for loop)

  1. Relevant commands, code, scripts, algorithms:
    Question:
    http://farm9.staticflickr.com/8064/8218215981\_a5b6aae00a_z.jpg

  2. The attempts at a solution (include all code and scripts):

if test -d $1    #check if argument is a directory.
then


for fileName in *
do  
echo "what is this::: $fileName"

done

fi
  1. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):
    York University, Toronto, Bil, cse203 1

Hi

if test -d $1    #check if argument is a directory.
then
    for fileName in $1
    do  
         [ -f $fileName ] &&  echo "what is this::: $fileName"
    done
fi
arg=$1

if [ -d "$arg" ]    #check if argument is a directory.
then

for fileName in "$arg/"*
do

if [ -f "$fileName" ]
then
 echo "what is this::: ${fileName##*/}"
fi

done

fi