OK, Thank, it work fine, I can even use ls *.bib | grep .... =========================================================================== Patrick DUPRÉ | | email: pdupre@xxxxxxx 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 11:56 PM > From: JD <jd1008@xxxxxxxxx> > To: users@xxxxxxxxxxxxxxxxxxxxxxx > Subject: Re: LS in a script file > > > > On 04/04/2017 03:35 PM, Patrick Dupre wrote: > > Hello, > > > > Sorry for the lack for clarity. > > I want to list all the file end in .bib, except the file ending by -e.bib > > This can be done by (from the shell command) > > ls -d !(*@(-e)).bib > > or by > > find . !(*@(-e)).bib > > > > but, as soon as I put one of these commands in a script file, it does not work > > > > Is it clear? > > > > =========================================================================== > > Patrick DUPRÉ | | email: pdupre@xxxxxxx > > 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 10:57 PM > >> From: JD <jd1008@xxxxxxxxx> > >> To: users@xxxxxxxxxxxxxxxxxxxxxxx > >> Subject: Re: LS in a script file > >> > >> > >> > >> On 04/04/2017 02:34 PM, Patrick Dupre wrote: > >>> find . !(*@(-e)).bib > >>> and > >>> ls -d !(*@(-e)).bib > >>> > >>> > >>> > >>> work fine in a command line, but never > >>> in a script > >>> command substitution: line 9: syntax error near unexpected token `(' > >>> > >>> ls -d !\(*@\(-e\)\).bib > >>> > >>> does not work > >>> > >>> =========================================================================== > >>> Patrick DUPRÉ | | email: pdupre@xxxxxxx > >>> 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@xxxxxxxxx> > >>>> To: users@xxxxxxxxxxxxxxxxxxxxxxx > >>>> 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@xxxxxxx > >>>>> <mailto:pdupre@xxxxxxx>>: > >>>>> > >>>>> Hello, > >>>>> > >>>>> How can I put this command in a script file? > >>>>> FILES=`ls -d !(*@(-e)).bib` > >>>>> > >>>>> I get an error because of the ( > >>>>> Have you tried to "escape" them > >>>>> > >>>>> > >>>>> FILES=`ls -d !\(*@\(-e\)\).bib` > >>>> For me, it works under bash like this: > >>>> > >>>> ls `[ ! \(*@\(-e\)\).bib ]` > >>>> _______________________________________________ > >>>> users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx > >>>> To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx > >>>> > >>> _______________________________________________ > >>> users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx > >>> To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx > >> Patrick, it would help the list members GREATLY, if you explain > >> in plain english, WHAT are you trying to achieve with that ls -d > >> .....etc command? > >> _______________________________________________ > >> users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx > >> To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx > >> > > _______________________________________________ > > users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx > > To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx > > OK, Try this: > > $ locate .bib | grep -v '\-e.bib' > /usr/share/doc/plotutils/libplot/hershey.bib > /usr/share/texlive/texmf-dist/bibtex/bib/base/xampl.bib > /usr/share/texlive/texmf-dist/bibtex/bib/gustlib/plbib.bib > /usr/share/texlive/texmf-dist/bibtex/bib/oberdiek/oberdiek-bundle.bib > /usr/share/texlive/texmf-dist/bibtex/bib/oberdiek/oberdiek-source.bib > /usr/share/texlive/texmf-dist/doc/plain/gustlib/readme.biblotex > /usr/share/texlive/texmf-dist/doc/texlive/texlive-en/archive/tex-live.bib > > If you do not have the locate package installed, then, simply: > > find <some-starting-path such as /> -name \*.bib | grep -v '\-e\.bib' > > for example: > > find /usr/share -name \*.bib | grep -v '\-e\.bib' > _______________________________________________ > users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx > To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx > _______________________________________________ users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx