Hello,

On Wed, May 25, 2005 at 11:38:43AM -0700, Paul Eggert wrote:
> > awk '/^ \t*case/,/^ \t*esac/{if(/\[\^.*\)/) exit(1)}'
> 
> That code looks incorrect.  " \t*" should be "[ \t]*", surely.

yes, ithat was my mistake, sorry.

> It's better to remove the test for now.

I agree.  When I thoought about the test, I wasn't able to invent somethig
usable.  As you pointed out, my test
        /^[ \t]*case/,/^[ \t]*esac/{if(/\[\^.*\)/) exit(1)}
will probably have many false positives.

The previous test,
        grep '\@<:@\^.*).*;;'
was very weak; it needed the pattern and ;; on the same line.  Yet it
also had a false positive; that was what brought my attention here.
(Yes, the workaround is to put ;; on a separate line, but this is ugly.)

So I conclude there is no good solution now and it's best to let it be.
Thank you, Paul, for fixing it.

(If we had a shell which is able to complain when it sees [^..], that
would be the real fix!)

Have a nice day,
        Stepan Kasal


Reply via email to