[Top][All Lists]

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

Re: basename/pwd

From: Bob Proulx
Subject: Re: basename/pwd
Date: Sun, 4 Aug 2002 10:38:52 -0600
User-agent: Mutt/1.4i

Hunter Peress <address@hidden> [2002-08-04 05:58:56 -0500]:
> give basename an option to do the opposite:
> EG: basename /home/lalal/lolo/sdds gives:
> sdds
> but 
>     basename -newoption gives:
> /home/lalal/lolo

I believe what you are looking for is 'dirname'.

  dirname /home/lalal/lolo/sdds

> ------------------------
> and give pwd the option to accept any file and spit out its absolute
> path.

That can also easily be accomplished using standard shell script
constructs.  How about this?

  (cd /path/to/some/file && pwd -P)

Of if you are on an older system without 'pwd -P':

  (cd /path/to/some/file && /bin/pwd)


reply via email to

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