Re: LS in a script file

2017-04-06 Thread Tom H
On Tue, Apr 4, 2017 at 3:43 PM, Pete Travis wrote: > > Do not parse ls. Make a find invocation, ie `find /path/ -not -name > $pattern`. Please don't top post. "find" also. http://mywiki.wooledge.org/ParsingLs ___ users mailing

Re: LS in a script file

2017-04-05 Thread Cameron Simpson
at 10:57 PM From: JD <jd1...@gmail.com> To: users@lists.fedoraproject.org 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 substitu

Re: LS in a script file

2017-04-04 Thread Gordon Messmer
On 04/04/2017 03:17 PM, Patrick Dupre wrote: I would imagine that you're using "#!/bin/sh" as the first line in the script, and bash is working in POSIX mode. Try using "#!/bin/bash" as the first line in the script. No, it does not help Ah. You have to set the extglob option, as documented

Re: LS in a script file

2017-04-04 Thread Patrick Dupre
i...@alldigital.com> > To: "Community support for Fedora users" <users@lists.fedoraproject.org> > Subject: Re: LS in a script file > > On 04/04/2017 02:35 PM, Patrick Dupre wrote: > > Hello, > > > > Sorry for the lack for clarity. > > I want to list all t

Re: LS in a script file

2017-04-04 Thread Rick Stevens
ERTHING below it, use: find . -maxdepth 1 -name "*.bib" -not -name "*-e.bib" to restrict the search to the current directory. Or use Joe's suggestion (which may be cleaner for you): ls -d *.bib | grep -v -e.bib >>> Sent: Tuesday, April 04, 2017 at 10:57 PM

Re: LS in a script file

2017-04-04 Thread Rick Stevens
.bib" and NOT named "*-e.bib"' Make sense? >> Sent: Tuesday, April 04, 2017 at 10:57 PM >> From: JD <jd1...@gmail.com> >> To: users@lists.fedoraproject.org >> Subject: Re: LS in a script file >> >> >> >> On 04/04/2017 0

Re: LS in a script file

2017-04-04 Thread Joe Zeff
On 04/04/2017 02:35 PM, Patrick Dupre wrote: 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 ls -d *.bib | grep -v -e.bib HTH, HAND.

Re: LS in a script file

2017-04-04 Thread Dave Stevens
On Tue, 4 Apr 2017 15:10:44 -0700 Gordon Messmer wrote: > On 04/04/2017 02:35 PM, Patrick Dupre wrote: > > 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 > >

Re: LS in a script file

2017-04-04 Thread Patrick Dupre
> On 04/04/2017 02:35 PM, Patrick Dupre wrote: > > 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 > > Note that "find" doesn't support that syntax. The find

Re: LS in a script file

2017-04-04 Thread Patrick Dupre
D <jd1...@gmail.com> > To: users@lists.fedoraproject.org > 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 t

Re: LS in a script file

2017-04-04 Thread Gordon Messmer
On 04/04/2017 02:35 PM, Patrick Dupre wrote: 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 Note that "find" doesn't support that syntax. The find command only works because

Re: LS in a script file

2017-04-04 Thread Ed Greshko
On 04/05/17 05:56, JD wrote: > locate .bib | grep -v '\-e.bib' "locate" is probably inappropriate if the files in question are created dynamically since locate depends on a database which is usually only updated once per day. -- Fedora Users List - The place to go to get others to do the work

Re: LS in a script file

2017-04-04 Thread JD
jd1...@gmail.com> To: users@lists.fedoraproject.org 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 `('

Re: LS in a script file

2017-04-04 Thread Patrick Dupre
t.org > 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 > >

Re: LS in a script file

2017-04-04 Thread JD
ubject: 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 <pdu...@gmx.com <mailto:pdu...@gmx.com>>: Hello, How can I put this command in a script file? FILES=`ls -d !(*@(-e)).bib` I get an error because

Re: LS in a script file

2017-04-04 Thread JD
Maurice Schumann | | 59140 Dunkerque, France === Sent: Tuesday, April 04, 2017 at 8:25 PM From: JD <jd1...@gmail.com> To: users@lists.fedoraproject.org Subject: Re: LS in a script file On 04/04/2017

Re: LS in a script file

2017-04-04 Thread Terry Polzin
Sent: Tuesday, April 04, 2017 at 8:25 PM > > From: JD <jd1...@gmail.com> > > To: users@lists.fedoraproject.org > > Subject: Re: LS in a script file > > > > > > > > On 04/04/2017 12:13 PM, Terry Polzin wrote: > > > > > > > > > 2017

Re: LS in a script file

2017-04-04 Thread Patrick Dupre
, France === > Sent: Tuesday, April 04, 2017 at 8:25 PM > From: JD <jd1...@gmail.com> > To: users@lists.fedoraproject.org > Subject: Re: LS in a script file > > > > On 04/04/2017 12:13 PM, Terry

Re: LS in a script file

2017-04-04 Thread Patrick Dupre
t; To: "Community support for Fedora users" <users@lists.fedoraproject.org> > Subject: Re: LS in a script file > > > > > > On Tuesday, April 4, 2017 3:02 PM, Patrick Dupre <pdu...@gmx.com> wrote: > > > > > >

Re: LS in a script file

2017-04-04 Thread Terry Polzin
llo, >> >> How can I put this command in a script file? >> FILES=`ls -d !(*@(-e)).bib` >> >> I get an error because of the ( >> >> > Good point. ___ users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-le...@lists.fedoraproject.org

Re: LS in a script file

2017-04-04 Thread Antonio Olivares
To: "Community support for Fedora users" <users@lists.fedoraproject.org> Subject: Re: LS in a script file On Tuesday, April 4, 2017 1:05 PM, Patrick Dupre <pdu...@gmx.com> wrote: Hello, How can I put this command in a script file? FILES=`l

Re: LS in a script file

2017-04-04 Thread Patrick Dupre
| | 59140 Dunkerque, France ===     Sent: Tuesday, April 04, 2017 at 8:45 PM From: "Antonio Olivares" <olivares14...@yahoo.com> To: "Community support for Fedora users" <users@lists.fedoraproject.org>

Re: LS in a script file

2017-04-04 Thread Pete Travis
Do not parse ls. Make a find invocation, ie `find /path/ -not -name $pattern`. -- Pete On Apr 4, 2017 1:05 PM, "Patrick Dupre" <pdu...@gmx.com> wrote: > Hello, > > How can I put this command in a script file? > FILES=`ls -d !(*@(-e)).bib

Re: LS in a script file

2017-04-04 Thread Antonio Olivares
On Tuesday, April 4, 2017 1:05 PM, Patrick Dupre <pdu...@gmx.com> wrote: Hello, How can I put this command in a script file? FILES=`ls -d !(*@(-e)).bib` I get an error because of the ( === Patrick

Re: LS in a script file

2017-04-04 Thread JD
On 04/04/2017 12:13 PM, Terry Polzin wrote: 2017-04-04 14:05 GMT-04:00 Patrick Dupre <pdu...@gmx.com <mailto:pdu...@gmx.com>>: 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 trie

Re: LS in a script file

2017-04-04 Thread Terry Polzin
2017-04-04 14:05 GMT-04:00 Patrick Dupre <pdu...@gmx.com>: > 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" t

LS in a script file

2017-04-04 Thread Patrick Dupre
Hello, How can I put this command in a script file? FILES=`ls -d !(*@(-e)).bib` I get an error because of the ( === Patrick DUPRÉ | | email: pdu...@gmx.com Laboratoire de Physico-Chimie de