Quantcast
Channel: Wild card expansion that works on command line but not in a bash script - Ask Ubuntu
Browsing index pages (2 articles)

Wild card expansion that works on command line but not in a bash script

I read that I must put the command shopt -s extglob in .bashrc in order to use !(XYZ) as a wild card expansion for everything in the current directory except XYZ. Testing indicated that cp -aruv...

View Article


Answer by steeldriver for Wild card expansion that works on command line but...

If you are using the default Ubuntu ~/.bashrc file, then extended globbing is enabled by default1 for interactive shells - which is why it works on the command line. Inside a script however, you will...

View Article

Browsing index pages (2 articles)


Latest Images