[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ale] bash, full filename



On Sat, Nov 29, 2003 at 01:49:39PM -0500, David Corbin wrote:
> How can I take a filename (which may or may not be relative) and convert it to 
> be a fully qualified filename, in bash?

If you can write a bit of C code and use an extra executable, there is a
function in libc called realpath that does exactly what you want.  See
man realpath for more info.

If that won't work, I don't think there's any way other than judicious
use of ls, dirname, basename, awk, and pipes.

HTH,
Jason
-- 
Jason Day                                       jasonday at
http://jasonday.home.att.net                    worldnet dot att dot net
 
"Of course I'm paranoid, everyone is trying to kill me."
    -- Weyoun-6, Star Trek: Deep Space 9