Re: bash command

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

 



It works fine in a command line,
 
but in a script, I get
 
#!/bin/bash
/usr/bin/rm -v !(GENBAS|fja.*|run.sh|test.sh|ZMAT*|out*)
 
./test.sh: line 2: syntax error near unexpected token `('
./test.sh: line 2: `/usr/bin/rm -v !(GENBAS|fja.*|run.sh|test.sh|ZMAT*|out*)'
 
 
[jwesterd@jwesterd-f33 aaa]$ ls -1
a
b
c
d
e
f
[jwesterd@jwesterd-f33 aaa]$ /usr/bin/rm   -v   !(a*|b*|c*|d*|e*)
removed 'f'
[jwesterd@jwesterd-f33 aaa]$ ls -1
a
b
c
d
e
[jwesterd@jwesterd-f33 aaa]$ echo $0
bash
 
seems to work?
 
Are there asterisks or quotes in the files you are affecting?
 
Cheers
 

John Westerdale 

Sr Container Consultant  RHCSA-8.2

Red Hat NYC Office/WFH 

john.westerdale@xxxxxxxxxx   

M: 201-376-9993     IM: jwesterd   He / Him / His

I respect your Life-Work balance.

No need to respond immediately if you receive this outside your normal working hours.

 
On Fri, Jun 4, 2021 at 2:27 PM Patrick Dupre <pdupre@xxxxxxx> wrote:
Hello,

Sorry, I am a bit of list
This command line works in a shell, but not in a bash
I may miss some quotes !
Thanks for your help.

/usr/bin/rm -v !(ZMAT*|out*|Out*|GENBAS|Note*)

===========================================================================
 Patrick DUPRÉ                                 | | email: pdupre@xxxxxxx
 Laboratoire interdisciplinaire Carnot de Bourgogne
 9 Avenue Alain Savary, BP 47870, 21078 DIJON Cedex FRANCE
 Tel: +33 (0)380395988                    | | Room# D114A
===========================================================================
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
_______________________________________________ users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux