On Tue, Apr 4, 2017 at 4:34 PM, Patrick Dupre <pdupre(a)gmx.com> wrote:
find . !(*(a)(-e)).bib
and
ls -d !(*(a)(-e)).bib
work fine in a command line, but never
in a script
command substitution: line 9: syntax error near unexpected token `('
ls -d !\(*(a)\(-e\)\).bib
does not work
============================================================
===============
Patrick DUPRÉ | | email: pdupre(a)gmx.com
Laboratoire de Physico-Chimie de l'Atmosphère | |
Université du Littoral-Côte d'Opale | |
Tel. (33)-(0)3 28 23 76 12 | | Fax: 03 28 65 82 44
189A, avenue Maurice Schumann | | 59140 Dunkerque, France
============================================================
===============
> Sent: Tuesday, April 04, 2017 at 8:25 PM
> From: JD <jd1008(a)gmail.com>
> To: users(a)lists.fedoraproject.org
> Subject: Re: LS in a script file
>
>
>
> On 04/04/2017 12:13 PM, Terry Polzin wrote:
> >
> >
> > 2017-04-04 14:05 GMT-04:00 Patrick Dupre <pdupre(a)gmx.com
> > <mailto:pdupre@gmx.com>>:
> >
> > Hello,
> >
> > How can I put this command in a script file?
> > FILES=`ls -d !(*(a)(-e)).bib`
> >
> > I get an error because of the (
> > Have you tried to "escape" them
> >
> >
> > FILES=`ls -d !\(*(a)\(-e\)\).bib`
> For me, it works under bash like this:
>
> ls `[ ! \(*(a)\(-e\)\).bib ]`
Read the original find command provided by one of the replies. Your
expression
won't work within find.