开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜