Hi,
I'm wondering if there is any kind of switch to disable regex in grep? I couldn't see anything obvious in the man page.
I'm writing a script that greps for a certain string in a file and if it's not there, it adds it; but the string contains asterisks which grep considers wild cards. So right now I need to set 2 variables to the same string, except one has the * chars escaped so grep doesn't think of them as wildcards.
For simplicity & maintainability it would be nice if I could just use the same variable in the grep as I do when appending the string to the file.
I'm wondering if there is any kind of switch to disable regex in grep? I couldn't see anything obvious in the man page.
I'm writing a script that greps for a certain string in a file and if it's not there, it adds it; but the string contains asterisks which grep considers wild cards. So right now I need to set 2 variables to the same string, except one has the * chars escaped so grep doesn't think of them as wildcards.
For simplicity & maintainability it would be nice if I could just use the same variable in the grep as I do when appending the string to the file.