basename(1) surprise

gwyn at brl-tgr.ARPA gwyn at brl-tgr.ARPA
Wed Aug 28 23:14:54 AEST 1985


> In article <1217 at hcrvx1.UUCP> hugh at hcrvx1.UUCP (Hugh Redelmeier) writes:
> >Under System V the "suffix" operand of basename is a regular expression
> > ... if the programmer fails to
> >quote the dot twice (once for the shell, and once for basename's
> >pattern matcher) it will match any character.  Thus
> >	basename cccc .c
> >yields
> >	cc
> 
> Not on my System V machines!  The example above prints "cccc".
> Of course - it could be the particular implementation but I see no
> need for a manufacturer to alter a shell script.  [The software
> is based on SysVr2 for Vax.]

Funny; "basename" version 1.4 (SVR2 VAX) has the problem Hugh reported.



More information about the Net.bugs.usg mailing list