
04-19-2007
|
|
Shell programmer, author
|
|
|
Join Date: Mar 2007
Location: Toronto, Canada
Posts: 2,362
|
|
Quote:
|
Originally Posted by njoshi
Hi,
Any help on this would be very appreciated.
I capture the full path & filename in a variable like (varFile=/home/user/extfile.txt). Now in my shell script I have to use only the filename part i.e. extfile.txt. How do I extract only the filename part from the variable?
|
Use shell parameter expansion:
Code:
filename=${varFile##*/}
|