| Author |
can variables be used as pattern for awk command?
|
anandkumar biyani
Greenhorn
Joined: Dec 06, 2011
Posts: 9
|
|
Hello everyone,
I wanted to know if we can use the variable as a pattern for awk command as shown below:
$c = "Dec Tue";
$log = `awk '/\$c/' in.txt`;
print $log;
I have to search for a pattern in $c occuring in file in.txt.
Thanks in advance.
|
 |
fred rosenberger
lowercase baba
Bartender
Joined: Oct 02, 2003
Posts: 10043
|
|
|
What happened when you tried it?
|
Never ascribe to malice that which can be adequately explained by stupidity.
|
 |
 |
|
|
subject: can variables be used as pattern for awk command?
|
|
|