Help in command line argument

Hi Friends
Please help me in below script
I have list of directories
directory1
directory2
directory3
.
.
.
directory n
under each directory has list of files.
I need to write a script using command line argument , getopt option.
If my commandline argument is directory1 then i need to get the output as list of files directory1 contains..
Ex:If i run the script i should get the below output
../test.sh directory1
Output should
file1
file2
file3
file4

.
Hm.. your requirements don't seem to make since getopts is used when you want to
treat passed in arguments as flags or options. So using getopts your command would
look something like the following.
../test.sh -t directory1
.
If you want to not use a flag then you would use the read command to read the file
and compare it to the passed in argument. Also I am not clear where your getting
the list of file names from? If your going to get the current file list then
why do you need the file that contains the directory names? You can just
take the passed in option or argument and do an ls on it provided it exists.
here is a common example of using getopts. remove the "." at the beginning of
each line it is just to preserve proper indentation.
.
#!/usr/local/bin/ksh
dir_list=/tmp/dir_file
.
while getopts "t:" opt;do
. case "$opt" in
. t) target=$OPTARG;
. grep $target $dir_list;
. if [ $? -eq 0 ];then
. if [ -d $target ];then
. ls -l $target;
. else
. echo "$target is not a valid directory"
. exit 1
. fi
. else
. echo "directory is not in the list";
. fi
. ;;
. *)
. echo "invalid option";
. exit 2;;
. esac
done
.
.