<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>
hi Tet, <br><br>I have tried your approach before,doesn't return anything !<br>I don't understand why the variable doesn't get passed to awk ! (takes it as an empty string) !<br><br>cheers<br>ak<br><br><div>> To: gllug@gllug.org.uk<br>> From: sta296@astradyne.co.uk<br>> Date: Mon, 12 Sep 2011 09:06:42 +0100<br>> Subject: Re: [Gllug] issues with awk<br>> <br>> <br>> Alain Williams writes:<br>> <br>> >$ip is in single quotes and so is not substituted by the shell.<br>> >The following might work (not tested):<br>> ><br>> >   awk --assign ip=$ip '$1==$ip {print}' test.txt<br>> <br>> Or in the more general case, for commands that don't let you assign<br>> variables on the command line:<br>> <br>>       awk '$1=='"$ip"' {print}' test.txt<br>> <br>> Tet<br>> --<br>> Gllug mailing list  -  Gllug@gllug.org.uk<br>> http://lists.gllug.org.uk/mailman/listinfo/gllug<br></div>                                       </div></body>
</html>