Re: Grepping an array in bash, odd/buggy behavior when using shopt and '!'

2010-02-03 Thread Greg Wooledge
On Tue, Feb 02, 2010 at 07:29:25PM -0800, Davey E wrote: > FOO[3]="ABZ555" > shopt -s extglob > echo '${f...@]/#!(ABZ555)/}' results in: ${f...@]/#!(ABZ555)/} > When run, I see: > ${f...@]/#!(ABZ555)/} results in: 5 You are trying to use a substitution operator to perform matching, which is not

Grepping an array in bash, odd/buggy behavior when using shopt and '!'

2010-02-02 Thread Davey E
Perhaps I'm missing something obvious here, but I'm trying to figure out an efficient way to search a large array in bash (I'm using bash 4.1 because I needed to use associative arrays) Given an array that contains alphanumeric strings, I want to create a smaller array of those elements that matc