bug-bash
[Top][All Lists]
Advanced

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

Re: basename, dirname why not built-in?


From: Chet Ramey
Subject: Re: basename, dirname why not built-in?
Date: Wed, 13 Feb 2002 09:33:30 -0500

> $ type basename
> basename is /bin/basename
> 
> OK, but I've seen a lost of built-ins that do more than basename...
> So how can one justify having built-ins for some of the simple stuff
> in /bin but not all of them?  Got to make a definition of where to
> draw the line.  Lots of them or none of them.
> 
> $ type dirname
> dirname is /usr/bin/dirname
> 
> Isn't that one just child's play to implement... wouldn't there be no
> better a justification for a built-in than dirname?  [save lots of CPU
> time per call.]

Use the built-in expansion facilities:  prefix and suffix removal and
pattern substitution.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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