Finding an absolute pathname



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)
.