shell编程:for循环结构

本文提供了两个使用Shell脚本进行for循环的例子,演示了如何通过不同的方式遍历文件并执行音频转换任务,适用于初学者理解Shell脚本的基础循环结构。

shell编程:for循环结构

  用法1:

s1=test.
s2=.wav
s3=.mp3
s4=0
s5=00
i=0
str="sox ./${s1}${i}${s2} ./${1}${s3}"
 ./tts -c bcgirl.0.0.4.bin -b 1 -i input.txt -s 1.0 -speed 1.0
 
for i in 0 1
do
sox ./${s1}${i}${s2} ./${i}${s3}
done
rm ./*.wav

  用法2:

s1=test.
s2=.wav
s3=.mp3
s4=0
s5=00
i=0
str="sox ./${s1}${i}${s2} ./${1}${s3}"
 ./tts -c bcgirl.0.0.4.bin -b 1 -i input.txt -s 1.0 -speed 1.0
 
for((i=0;i<4;i++))
do
sox ./${s1}${i}${s2} ./${i}${s3}
done
rm ./*.wav

  

转载于:https://www.cnblogs.com/kay2018/p/10673249.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值