ɹəuəllıʍ ʇɐb Posted November 13, 2005 Report Share Posted November 13, 2005 Using the vi editor on HPUX today (yes, this person is working today, despite the beautiful autumn weather), I had to find a certain constant in a large file. The constant was 'EQUAL/IN' (without the apostrophe). So I entered the following command in vi:/EQUAL/INand hit the enter key. Nothing happened.It seems that the slash in my search constant interferes with the slash search command. Is there any way to specify a slash in the search constant? Some kind of escape, perhaps?Sorry for asking Unix questions in the Linux forum :blush: but I believe it's pretty close. Quote Link to comment Share on other sites More sharing options...
trackrat Posted November 13, 2005 Report Share Posted November 13, 2005 This would be a better place to post this question Pat.http://www.unix-manuals.com/forum/index.php Quote Link to comment Share on other sites More sharing options...
scuzzman Posted November 14, 2005 Report Share Posted November 14, 2005 The escape character is a backslash (\). The string you want is /EQUAL\/IN Quote Link to comment Share on other sites More sharing options...
ɹəuəllıʍ ʇɐb Posted November 14, 2005 Author Report Share Posted November 14, 2005 This would be a better place to post this question Pat.http://www.unix-manuals.com/forum/index.phpThanks for the link; I will visit when I have another Unix question.The escape character is a backslash (\). The string you want is /EQUAL\/INThanks for the backslash - it works! Quote Link to comment Share on other sites More sharing options...
ɹəuəllıʍ ʇɐb Posted November 15, 2005 Author Report Share Posted November 15, 2005 Just found that the backslash excape character also works for grep and fgrep. Quote Link to comment Share on other sites More sharing options...
scuzzman Posted November 15, 2005 Report Share Posted November 15, 2005 Yep. Also works with Perl, and just about anything else you can come up with :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.