![]() |
|
|
|||||||
| Home | Forums | Register | Rules & FAQ | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
Other UNIX.COM Threads You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with GREP. | syndex | Shell Programming and Scripting | 2 | 07-11-2007 10:44 AM |
| grep problem | asal_email2 | UNIX for Dummies Questions & Answers | 4 | 06-22-2005 05:49 PM |
| grep problem | svennie | UNIX for Dummies Questions & Answers | 5 | 11-08-2004 12:29 AM |
| Grep Problem | lesstjm | Shell Programming and Scripting | 2 | 10-27-2004 07:13 AM |
| Grep problem | odogbolu98 | Shell Programming and Scripting | 3 | 02-18-2003 11:53 AM |
![]() |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
grep problem
Hi
I would like to know wheather there is anyway to pass a variable to grep argument like this grep "$myvar" $myfile i would put this in a function and then call this function by setting different values to myvar and myfile. is this possible at all. regards Hrishy |
| Forum Sponsor | ||
|
|
|
|||
|
you could try it. but from what i recall. by default grep will take 2 arguemnts. and if the argument is part of the metacharter set it ie your "$" will make the next charters a variable.
First: try without any quotes. if that does not work try w/ single quotes around each variable. also makesure you echo your variable befor the grep statement (just for testing) to make sure you are passing information to the variable. |
|||
| Google UNIX.COM |