I tried to find the actual practical use of ? i.e. for e.g. "egrep a? filename" but was not able to find any.. It returns all results..
So, Please help me out wherein i could know the actual use of egrep ? command..
If i use 'a?', it returns all result i.e. strings or lines. which has 0 a's, 1 a's, 2 a's and so on.. i.e. i am not able to find the use of the same..
Thanks
Best Answer
Say you wanted to match numeric assignment expressions like this in a script:
where some numbers are negative and have a minus sign:
You could use this:
The question mark makes the minus optional.
(I don't think plain grep supports
?
or+
, hence-E
).