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

Re: brace expansion in ash?

Bob McGowan wrote:

> Peter S Galbraith wrote:
> > 
> > I was doing this in a Makfile:
> > 
> >   install -m 644 debian/{0*,READ*,c*,gri*,watch} gri-2.6.0/debian
> > 
> > and it turns out the brace expansion is a bashism, as ash doesn't
> > support it.  Is there a sh-compliant way of doing this?  I looked
> As you say, this is a bashism (also found, IIRC, in the csh family). 


> The only option is to use character ranges and be careful in the
> selection of the characters.  Using your 'install' example:
>    install -m 644 debian/[0Rcgw]* gri-2.6.0/debian
> But this would only work correctly if each letter in the range is unique
> to the files you want.  For instance, the file 'Readme' would also match
> but might not be part of what you want to install.

I could do it using:

 ( cd debian ; install -m 644 0* READ* c* gri* watch ../gri-2.6.0/debian)

Not as elegant, but it works.  Basically, all I want to do is
copy everything over except the CVS directory.

Thanks for your answer,

Reply to: