![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with GREP. | syndex | Shell Programming and Scripting | 2 | 07-11-2007 01:44 PM |
| grep problem | asal_email2 | UNIX for Dummies Questions & Answers | 4 | 06-22-2005 08:49 PM |
| grep problem | svennie | UNIX for Dummies Questions & Answers | 5 | 11-08-2004 04:29 AM |
| Grep Problem | lesstjm | Shell Programming and Scripting | 2 | 10-27-2004 10:13 AM |
| Grep problem | odogbolu98 | Shell Programming and Scripting | 3 | 02-18-2003 03:53 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
i am writing a program that will search for a pattern in all the file in a particular directory and replace the pattern with a given pattern.
but the problem is this pattern i am searching may contain special characters like $,#,&,* etc. but when the user is entering the pattern i dont want her to give the trouble of writing a backslash everytime he writes a special character. how can i modify my program so that i can trace the pattern with or without special characters without writing ' \' before every special character? |
|
|||||
|
If you don't need to worry about metacharacters at all, try "fgrep" (or grep -F on some systems) - this is "fixed" grep which greps for fixed strings.
Then fgrep 'string$with&special*chars' file would work and match the literal characters EDIT: Please read the rules - duplicate and cross posting is not permitted. I have deleted the duplicate post from the Unix for Dummies forum. If somebody can provide an answer (as I have) - they will give it - duplicating posts does not safeguard a prompt response! Cheers ZB Last edited by zazzybob; 11-30-2004 at 05:55 AM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|