Need customized output filename using awk command
<p>How to split file via <code>awk</code> command and customize the name of the output file?</p>

<p>I have tried,</p>

<pre><code>awk -v RS=$val '{ outfile = "'$filename'""." NR "'.${extension}'"; print &gt; outfile}' $file
</code></pre>