Finding an absolute pathname
- From: Colin Brough <Colin.Brough@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 28 Feb 2007 12:31:17 GMT
Given a file argument is there a quick way to translate it into an
absolute path? I can do it for a file in the current directory or one
that is already an absolute filename - but not for a relative path...
So, help me write:
function fullpath () {
# What goes here?
}
So that:
cmb > pwd
/home/cmb
cmb > fullpath file
/home/cmb/file
cmb > fullpath tmp/file
/home/cmb/tmp/file
cmb > cd bar
cmb > fullpath ~/tmp/file
/home/cmb/tmp/file
cmb > fullpath ../tmp/file
/home/cmb/tmp/file
Cheers
Colin
--
----------------------------------------------------------------------
Colin Brough Colin.Brough@xxxxxxxxxxxxxxxxxx
(Replace .invalid with .co.uk to reply)
.
- Follow-Ups:
- Re: Finding an absolute pathname
- From: Liam O'Toole
- Re: Finding an absolute pathname
- From: Tim
- Re: Finding an absolute pathname
- From: Andy Burns
- Re: Finding an absolute pathname
- From: Geoffrey Clements
- Re: Finding an absolute pathname
- Prev by Date: Re: Hacks
- Next by Date: Re: parcelforce website
- Previous by thread: Open source article - Birmingham Post
- Next by thread: Re: Finding an absolute pathname
- Index(es):