On 04/04/2017 02:57 PM, JD wrote:


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: [email protected]
  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 <[email protected]>
To: [email protected]
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 <[email protected]
<mailto:[email protected]>>:

     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 -- [email protected]
To unsubscribe send an email to [email protected]

_______________________________________________
users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
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?

I ran your command in my home dir as follows:

$ ls -d `[ !(*@(-e)).bib \]`
./

As you can see, it only lists ./ as the directory (which is what the -d tells ls to restrict it's listing of. So, something is not 'right' with your concoction or 'usage' of the params you are passing to ls.
_______________________________________________
users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to