According to Jim Meyering on 2/13/2010 7:55 AM:
>> For negated character classes in shell case statements, POSIX says to use
>> [!a-z], not [^a-z].
> 
> I've made that change, too.
> Does it matter in practice?

It matters for at least Solaris /bin/sh.

$ /bin/sh -c 'case a in [^b]) echo yes;; *) echo no;; esac'
/bin/sh: syntax error at line 1: `^' unexpected
$ /bin/sh -c 'case a in [!b]) echo yes;; *) echo no;; esac'
yes

But that particular example is a moot point, given the use of $().

> That's certainly more efficient.
> Since it's less readable to me, I've added a comment.

Indeed.  And it still needs a tweak:

> +      *) # Remove leading file name components as well as the .exe suffix.
> +         feb_file_=${${feb_file_##*/}%.exe}
>        feb_result_="$feb_result_$feb_sp_$feb_file_";;

Won't work as written, the % operator only works on variable names, but
${feb_file_##*/} is not a variable name.  Instead, you need an
intermediate store:

feb_file_=${feb_file_%.exe}
feb_file_=${feb_file_##*/}

-- 
Don't work too hard, make some time for fun as well!

Eric Blake             [email protected]

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to