[Gllug] issues with awk

Tethys sta296 at astradyne.co.uk
Mon Sep 12 08:06:42 UTC 2011


Alain Williams writes:

>$ip is in single quotes and so is not substituted by the shell.
>The following might work (not tested):
>
>	awk --assign ip=$ip '$1==$ip {print}' test.txt

Or in the more general case, for commands that don't let you assign
variables on the command line:

	awk '$1=='"$ip"' {print}' test.txt

Tet
--
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list