I feel stupid -- determine the full path to a file

Derek Carter goozbach at friocorte.com
Thu Dec 6 11:24:54 MST 2007


Michael L Torrie wrote:
> I have a script that is passed a filename.  This filename could be
> absolute, it could be relative.  I need the script to be able to
> determine the pull path to this file.  I've read lots of hacks for doing
> this that involve ls, find, and pwd, but none of them do what I need.
> If the script was invoked like this,
> 
> foo ../bar
> 

Try dirname and basename

--
Goozbach



More information about the PLUG mailing list