Grep for "ab?c12345678" From a file
Hello,
How to grep a string like "ab?c12345678" where 3rd character is unknown, while other characters are known. |
Stick a dot in there instead, unless by using the question mark you are saying that it may or may not be there?
Code:
ab.c12345678 |
Type "man grep" at a terminal and then "/REGULAR EXPRESSIONS":
"The period . matches any single character." So: grep 'ab.c12345678' file will search file for lines containing the above string with any character in the third position. And: echo $string | grep 'ab.c12345678' will search $string for the same pattern. |
All times are GMT -5. The time now is 10:33 AM. |