snipt

Ctrl+h for KB shortcuts

Bash

bash variable in awk

awk '{print "'"$VAR1"'", "'"$VAR2"'"}'
https://snipt.net/embed/bbb94c56e594a4e17168303d9e7402b8/
/raw/bbb94c56e594a4e17168303d9e7402b8/
bbb94c56e594a4e17168303d9e7402b8
bash
Bash
1
2019-05-19T10:49:25
True
False
False
/api/public/snipt/5689/
bash-variable-in-awk
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>awk <span class="s1">&#39;{print &quot;&#39;</span><span class="s2">&quot;</span><span class="nv">$VAR1</span><span class="s2">&quot;</span><span class="s1">&#39;&quot;, &quot;&#39;</span><span class="s2">&quot;</span><span class="nv">$VAR2</span><span class="s2">&quot;</span><span class="s1">&#39;&quot;}&#39;</span> </span></pre></div> </td></tr></table>
awk, bash