SyntaxFix
Write A Post
Hire A Developer
Questions
Use the basename command to extract the filename from the path:
[/tmp]$ export fspec=/exp/home1/abc.txt [/tmp]$ fname=`basename $fspec` [/tmp]$ echo $fname abc.txt