![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ksh pattern matching | ripat | Shell Programming and Scripting | 5 | 02-10-2008 04:44 PM |
| help need for pattern matching | HIMANI | UNIX for Dummies Questions & Answers | 10 | 01-22-2008 07:30 AM |
| pattern matching | mercuryshipzz | Shell Programming and Scripting | 4 | 01-14-2008 11:01 PM |
| pattern matching in an if-then | lumix | Shell Programming and Scripting | 4 | 12-14-2007 04:25 PM |
| Pattern matching sed | leemjesse | Shell Programming and Scripting | 3 | 03-23-2005 04:06 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
pattern matching
Hello all,
I'm having a problem and would like to know if anyone has a solution. I would like to search my /etc/hosts file for and ip address say 10.1.1.1. I'm currently have this IP address as a variable, but I only what it to match it. I have grep $IP /etc/hosts. grep `\< $IP>\` /etc/hosts grep "IP" /etc/hosts sed 's/\^$IP\$/p' /etc/hosts This would give my everything like 10.1.1.1*, but I only want 10.1.1.1. I have problem with passing a vaiable to the sed command when I want to use reg expression. I |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|