snipt

Ctrl+h for KB shortcuts

Bash

bash integer padding

printf "%03d\n" 12
https://snippets.siftie.com/embed/04bc98ec58e2bda85e1a50b34079b762/
/raw/04bc98ec58e2bda85e1a50b34079b762/
04bc98ec58e2bda85e1a50b34079b762
bash
Bash
1
2019-03-15T00:26:30
True
False
False
/api/public/snipt/5690/
bash-integer-padding
<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><span class="nb">printf</span> <span class="s2">&quot;%03d\n&quot;</span> 12 </span></pre></div> </td></tr></table>
bash, printf

Bash

bash variable in awk

awk '{print "'"$VAR1"'", "'"$VAR2"'"}'
https://snippets.siftie.com/embed/bbb94c56e594a4e17168303d9e7402b8/
/raw/bbb94c56e594a4e17168303d9e7402b8/
bbb94c56e594a4e17168303d9e7402b8
bash
Bash
1
2019-03-19T18:44:07
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