Nov 4, 2004 #1 BryanY MIS Aug 18, 2001 54 US Basically, I have a file location stored as a string. Ex: "/export/home/user/data.txt I would like to remove the filename from the path. Ex: "/export/home/user" How would I do that? ("/export/home/user/" is also OK)
Basically, I have a file location stored as a string. Ex: "/export/home/user/data.txt I would like to remove the filename from the path. Ex: "/export/home/user" How would I do that? ("/export/home/user/" is also OK)
Nov 4, 2004 #3 PHV MIS Nov 8, 2002 53,708 FR man dirname a="/export/home/user" # the dirname way echo $(dirname a) # the ksh way echo ${a%/*} Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244 Upvote 0 Downvote
man dirname a="/export/home/user" # the dirname way echo $(dirname a) # the ksh way echo ${a%/*} Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244