bug-coreutils
[Top][All Lists]
Advanced

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

Re: basename sucks (OT)


From: Bauke Jan Douma
Subject: Re: basename sucks (OT)
Date: Fri, 02 Feb 2007 18:38:25 +0100
User-agent: Thunderbird 1.5.0.9 (X11/20061206)

Andreas Schwab wrote on 02-02-07 18:18:
address@hidden (Bob Proulx) writes:

Then Mike's suggestion of using the shell directly is the best choice
for efficiency.  No process forks and everything is done internally to
the shell.  It should be quite fast.

  dirname - ${foo%/*}

Note that this is not a full replacement.  It doesn't correctly handle
names without a directory component.

Reminds me of something.  This is largely off-topic, but
does anyone know of a utility FOO that takes a path or file
as input an outputs a full, absolute, rooted path?

E.g.

$> cd / && FOO /etc/termcap
/etc/termcap

$> cd /etc && FOO termcap
/etc/termcap

$> cd /etc && FOO ../etc/./termcap
/etc/termcap


bjd





reply via email to

[Prev in Thread] Current Thread [Next in Thread]