
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.thelinuxwiki.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.thelinuxwiki.com/index.php?action=history&amp;feed=atom&amp;title=bash_variable_inside_awk</id>
		<title>bash variable inside awk - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://www.thelinuxwiki.com/index.php?action=history&amp;feed=atom&amp;title=bash_variable_inside_awk"/>
		<link rel="alternate" type="text/html" href="http://www.thelinuxwiki.com/index.php?title=bash_variable_inside_awk&amp;action=history"/>
		<updated>2026-05-01T21:02:25Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.21.5</generator>

	<entry>
		<id>http://www.thelinuxwiki.com/index.php?title=bash_variable_inside_awk&amp;diff=1081&amp;oldid=prev</id>
		<title>Nighthawk: Created page with &quot;taken from [http://stackoverflow.com/questions/19075671/how-to-use-shell-variables-in-an-awk-script How to use shell variables in an awk script]  This is the best way to do it...&quot;</title>
		<link rel="alternate" type="text/html" href="http://www.thelinuxwiki.com/index.php?title=bash_variable_inside_awk&amp;diff=1081&amp;oldid=prev"/>
				<updated>2017-05-10T01:44:24Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;taken from [http://stackoverflow.com/questions/19075671/how-to-use-shell-variables-in-an-awk-script How to use shell variables in an awk script]  This is the best way to do it...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;taken from [http://stackoverflow.com/questions/19075671/how-to-use-shell-variables-in-an-awk-script How to use shell variables in an awk script]&lt;br /&gt;
&lt;br /&gt;
This is the best way to do it. It uses the -v option: (P.S. use a space after -v or it will be less portable. E.g., awk -v var= not awk -vvar)&lt;br /&gt;
&lt;br /&gt;
 variable=&amp;quot;line one\nline two&amp;quot;&lt;br /&gt;
 awk -v var=&amp;quot;$variable&amp;quot; 'BEGIN {print var}'&lt;br /&gt;
 line one&lt;br /&gt;
 line two&lt;br /&gt;
&lt;br /&gt;
[[category:awk]]&lt;/div&gt;</summary>
		<author><name>Nighthawk</name></author>	</entry>

	</feed>