我想要一個shell腳本,它檢查聲音文件的長度並檢查長度是否比指定長度短。但是我一直在if語句中收到錯誤信息「command not found」。 #!/bin/bash
soundlength=$(soxi -D $1)
enter code here
if [$soundlength < $2]
then
# do something
fi
我猜$ soundlen
我在.aiff格式的目錄中有多個文件,並且我想使用SoX將它們轉換爲.wav。我曾嘗試代碼上this網站,這是如下 theFiles = `/Users/me/RainbowAiff/*.aiff`;
for eachFile in $theFiles; do v1=${eachFile%*.aiff};
oldFile="$v1.aiff"; newFile = "$v1.wav";
ec