| Author |
grep related question
|
Sujoy Choudhury
Ranch Hand
Joined: Sep 17, 2008
Posts: 132
|
|
Hi,
I am trying to find a particulat line from a file.
My ksh code as below
But this doesn't evaluate $KEY so doesn't return any line.
How can I achieve that?
|
Thanks and Regards,
~Sujoy
|
 |
Sujoy Choudhury
Ranch Hand
Joined: Sep 17, 2008
Posts: 132
|
|
I could figure this out, the solution is:
`grep '^'"$KEY"'_somestring' someFile.txt | awk -F= '{print $2}'`
|
 |
Anand Hariharan
Rancher
Joined: Aug 22, 2006
Posts: 252
|
|
You don't need to grep and pipe it to awk. This -
- should suffice.
|
"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away." -- Antoine de Saint-Exupery
|
 |
 |
|
|
subject: grep related question
|
|
|