Re: basename/pwd
[email protected] (Bob Proulx) Sun, 4 Aug 2002 10:38:52 -0600
| Newsgroups | gmane.comp.gnu.sh-utils.bugs |
|---|---|
| Message-ID | <[email protected]> |
Hunter Peress <[email protected]> [2002-08-04 05:58:56 -0500]: > SUGGEST: > > 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 /home/lalal/lolo > ------------------------ > 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) Bob