[SunHELP] shell var & awk

DAUBIGNE Sebastien - BOR ( SDaubigne@bordeaux-bersol.sema.slb.com ) SDaubigne at bordeaux-bersol.sema.slb.com
Thu Oct 24 03:32:56 CDT 2002


Another way to do this is to use awk global variables assignement :

awk '{ print yadda }' yadda=$YADDA ......

Useful if you reference the variable multiple times in the awk script.

---
Sebastien DAUBIGNE
sdaubigne at bordeaux-bersol.sema.slb.com <mailto:sebastien.daubigne at sema.fr>
- (+33)5.57.26.56.36
SchlumbergerSema - SGS/DWH/Pessac


	-----Message d'origine-----
	De:	Lumpkin, Buddy [SMTP:Buddy.Lumpkin at nordstrom.com]
	Date:	mercredi 23 octobre 2002 23:56
	@:	Markham, Richard; Sunhelp (E-mail)
	Objet:	RE: [SunHELP] shell var & awk

	awk '{ print '${YADDA}' }'.

	The single ticks turn off shell interpolation. You can turn it back
on by just
	adding single ticks around any pieces of the command that you want
the shell
	to interpolate.

	--Buddy

	-----Original Message-----
	From: Markham, Richard [mailto:RMarkham at hafeleamericas.com]
	Sent: Wednesday, October 23, 2002 2:13 PM
	To: Sunhelp (E-mail)
	Subject: [SunHELP] shell var & awk


	Can I reference a shell variable within an awk statement?

	ie.   awk '{ print ${YADDA} }'
	?
	TIA
	_______________________________________________
	SunHELP maillist  -  SunHELP at sunhelp.org
	http://www.sunhelp.org/mailman/listinfo/sunhelp
	_______________________________________________
	SunHELP maillist  -  SunHELP at sunhelp.org
	http://www.sunhelp.org/mailman/listinfo/sunhelp



More information about the SunHELP mailing list