remove leading "./" in a batch script
<pre><code>for f in ./*.mp3; do sox "$f" "${f%%.mp3}processed.mp3" silence 1 0.02 1% -1 0.02 1%; done
</code></pre>

<p>This is a script I'm using to process audio files. The problem is that it keeps going in a loop, processing the new audio files as well. I'd like to fix this by having the output go in a subfolder, so I tried this:</p>

<pre><code>for f in ./*.mp3; do sox "$f" "/subfolder${f%%.mp3}processed.mp3" silence 1 0.02 1% -1 0.02 1%; done
</code></pre>

<p>This is the output:</p>

<pre><code>/subfolder./01processed.mp3
</code></pre>

<p>This is giving me an error with Sox, I need to remove the ./ before the filename output, how might I do that? This is the output I'd like to have:</p>

<pre><code>/subfolder/01processed.mp3
</code></pre>