Reputation: 6753
I am trying to use the following grep command
grep "Fred\(eric\)\? Smith" names.txt
where names.txt contains Fred Smith and Frederic Smith. However, grep only matches Frederic Smith. So, is ? supported in grep where ? refers to the character occurring 0 or 1 time.
Upvotes: 0
Views: 199
Reputation: 57650
AIX uses UNIX grep. So it supports basic RE. But I suggest you use extended RE with -E
option. Then you dont have escape those special characters.
grep -E "Fred(eric)? Smith" names.txt
Upvotes: 1