[Gllug] issues with awk

dudes dudes akam123 at hotmail.co.uk
Mon Sep 12 08:42:21 UTC 2011


thanks ever so much Tet, that "QUOTING" bit fixed all the issues. 

cheers
Ak

> To: gllug at gllug.org.uk
> From: sta296 at astradyne.co.uk
> Date: Mon, 12 Sep 2011 09:38:28 +0100
> Subject: Re: [Gllug] issues with awk
> 
> 
> dudes dudes writes:
> 
> >I have tried your approach before,doesn't return anything !
> 
> Oops. I forgot the match needed to be a string:
> 
> 	awk '$1=="'"$ip"'" {print}' test.txt
> 
> >I don't understand why the variable doesn't get passed to awk !
> >(takes it as an empty string) !
> 
> As Alain explained, the single quotes mean that the shell doesn't
> perform variable expansion. See the "QUOTING" secion of the bash
> man page.
> 
> Tet
> --
> Gllug mailing list  -  Gllug at gllug.org.uk
> http://lists.gllug.org.uk/mailman/listinfo/gllug
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20110912/ec0e3c20/attachment.html>
-------------- next part --------------
--
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list