going through files in a directory, and it's sub-directories

i have a c-shell script.
and i pass it one or two arguments
the first argument is the directory
the second is the "-r"
now,
if i pass it only one, it searches the files ending in txt in that directory
if i pass it two parameters, like "temp" and "-r"
i want it to go through all the files and FOLDERS, of "temp", to search through.

so i was thinking,

if( $argv[2] == "-r") then {

go through all files and FOLDERS, of $argv[1]


}

im new in csh, and i don't know how to write the code

---------- Post updated at 03:06 PM ---------- Previous update was at 01:47 PM ----------

anybody? i really need this to get done pls

Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.