Arlinta Barus wrote: > Thanks for the reply. > > " We can't use and/or escape `]' between `[' and `]' in grep and egrep". > So does it mean that grep cannot support a range character set that > the end of the range is character ']' ? Because in the real problems, > it is possible that we want to find a character in a range such > that ']' is the end of the range.
] is supported but not in a rage, so you can do echo 'ab23c]' | LC_ALL=C grep -o --color '[]1-\]' ie, extend the range until the character preceding the ] and include ] separately. -- D.
