C Shell Scripting - Remove PathName up to FileName
So the final p开发者_如何转开发art I'm missing in my assignment is a way to print ONLY the file names (rather than ./usr/etc/folder/directory/file.pdf, I want to print file.pdf) but I can't remember how to do this. What is the best/shortest way to accomplish this?
basename
Simple answer: use /usr/bin/basename
Since using C Shell the correct answer is use string modifier :t
to get the filename.
Example set FILENAME = $PATH:t
精彩评论