[Top][All Lists]

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

Re: [FYI] Remove $SED from basename and dirname definitions

From: Scott James Remnant
Subject: Re: [FYI] Remove $SED from basename and dirname definitions
Date: Fri, 13 Feb 2004 07:25:58 +0000

On Fri, 2004-02-13 at 06:57, Ralf Wildenhues wrote:

> * Scott James Remnant wrote on Thu, Feb 12, 2004 at 08:20:38PM CET:
> >
> > +   *,, commit, config/mailnotify: Remove
> > +   $SED from definitions of $dirname and $basename and prefix each
> > +   use with it instead.  Some shells (zsh) treat the expansion as
> > +   a single command instead of a command with arguments.
> > +
> Just curious: should't zsh be configurable to change this behaviour?
> This does not sound sh-compatible to me.  Are there any other shells
> exhibiting this behaviour?
The trouble is defining sh compatible...  I have a dim recall that ksh
behaves like this too, it's well within the permissible behaviour for a
shell anyway.

> > +basename="s,^.*/,,g"
> >  # The name of this program:
> > -progname=`echo "$progpath" | $basename`
> > +progname=`echo "$progpath" | $SED $basename`
> With above change, IMVHO you need "$basename" here, else pathname
> expansion will apply.  Same with other occurrences of dirname and
> basename.
It'd only work if you had a filename of ",,g" in a directory beginning
"s,^.", but yeah, for safety we should quote those... FYI on its way.

Have you ever, ever felt like this?
Had strange things happen?  Are you going round the twist?

Attachment: signature.asc
Description: This is a digitally signed message part

reply via email to

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