Thank you for your replies. I am still having a bit of difficulty and would appreciate a followup, if possible.
I am using the c shell, and have been exposed to one of its shortcomings, namely that it does not support the use of functions. I am trying to use the commands that you guys showed me in the above function, but am running into problems.
There seems to be a disparity between the generated output when I type the commands directly into the command line compared to when I try to input them in my .cshrc.pers file.
In the command line, i type " ls -td */ | head -n1 ", and I get the latest director as output.
But when I try to set an alias for it in my .cshrc file I get the response "too many argument". My code is,
setenv LATEST \ls -td */ | head -n1
alias cdlast cd $LATEST
In fact if I just try to do the setenv from the command line, I get the same error, i.e. "too many arguments".
Please help me out, (in addition to just saying "too bad, so sad! Use bash!"