需要删除函数中的开头./字符 [英] Need to strip the beginning ./ characters in a function

查看:80
本文介绍了需要删除函数中的开头./字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

./*.mp3中f的

; do sox$ f$ {f %%。mp3} processed.mp3沉默1 0.02 1%-1 0.02 1%;完成





这是我用来处理音频文件的脚本。问题是它继续循环,处理新的音频文件。我想通过将输出放在子文件夹中来解决这个问题,所以我尝试了这个:



对于./ *中的f。 MP3; do sox$ f/ subfolder $ {f %%。mp3} processed.mp3沉默1 0.02 1%-1 0.02 1%;完成





这是输出:



 /subfolder./01processed.mp3 





这给我一个SoX错误,我需要在文件名之前删除./输出,我该怎么做?这是我想要的输出:



 /subfolder/01processed.mp3 





我尝试了什么:



我试过指示一个子文件夹,但我似乎无法从文件名中删除前导./,这使得SoX崩溃。

解决方案

f


{f %%。mp3} processed.mp3沉默1 0.02 1%-1 0.02 1%;完成





这个是一个我用来处理音频文件的脚本。问题是它继续循环,处理新的音频文件。我想通过将输出放在子文件夹中解决这个问题,所以我试过这个:



 for f in ./*.mp3; do sox


f /子文件夹

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



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:

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



This is the output:

/subfolder./01processed.mp3



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:

/subfolder/01processed.mp3



What I have tried:

I tried indicating a subfolder, but I can't seem to remove the leading ./ from the filename, and that's making SoX crash.

解决方案

f" "


{f%%.mp3}processed.mp3" silence 1 0.02 1% -1 0.02 1%; done



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:

for f in ./*.mp3; do sox "


f" "/subfolder


这篇关于需要删除函数中的开头./字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆