Grep reg. express problem

When in the vi editor, I can find where the value of variables in COBOL programs (everything is uppercase) get changed with

/[NOTEP][EGMOT]  *ACCT-BALANCE

and it will find the last two characters of reserved words such as ACCEPT, FROM, TO, and COMPUTE followed by at least one space before the variable I'm looking for.
Running something similar through grep such as

grep "[NOTEP][EGMOT]  *ACCT-BALANCE" *.CBL

would display all occurrences of ACCT-BALANCE with or without a keyword or leading space (BACCT-BALANCE for example). In both cases, there are two spaces before the asterisk.

What am I missing?

TIA

I cannot reproduce this. Your grep seems to works OK. Could you post a sample?

1 Like

Sorry, I couldn't reproduce it either. It displayed every line containing the field name regardless of leading keywords or something other than a space in front of it but I can't find the grep command I used, it rolled off the screen.

At any rate, thanks for looking at it.