我需要获取从linux shell中的文件获取的文件名的长度。这是我的代码:
#!/bin/bash
locate /var/log/orkaudio/ | grep ".wav" | grep -v left | grep -v right > ficherosOrkAudio.txt
while read filePath ; do
filePathLenght = ${#filePath}
echo $filePathLenght
done <ficherosOrkAudio.txt
但是当我运行bash文件时,我得到:
./procesoTest: line 6: filePathLenght: command not found
./procesoTest: line 6: filePathLenght: command not found
./procesoTest: line 6: filePathLenght: command not found
./procesoTest: line 6: filePathLenght: command not found
./procesoTest: line 6: filePathLenght: command not found
./procesoTest: line 6: filePathLenght: command not found
./procesoTest: line 6: filePathLenght: command not found
请帮我解决问题。