脚本可以正常运行,但是当脚本完成错误时我不明白
是我的大代码,语法错误接近意外令牌`done'
#!/bin/bash
# Function Definition
function process_video {
python vid-xml-decoder/ultimate.py $1
repExport="./export/"
find . -name "*.flv" | while read line
do
name="$(basename "${line}" .flv)"
echo "${name}"
ffmpeg -i "${name}.flv" -vcodec copy -acodec copy mkvtemp.mkv
mkvmerge -v -o "${repExport}${name}.mkv" --default-track 0 --language 0:fre "${name}.ass" mkvtemp.mkv && \
rm -rf "${name}".flv "${name}".ass mkvtemp.mkv
done
}
# Bash Menu
clear
echo "dl master"
PS3='entrez votre chois: '
options=("Creation du cookies.txt" "Téléchargement de la video" "Quit")
select opt in "${options[@]}"
do
case $opt in
"Creation du cookies.txt")
python vid-xml-decoder/login.py 1$
break
;;
"Téléchargement de la video")
read -p "entrer Liens Video ou chemin/nom d'un fichier contenant des liens:" vid
if [[ -e $vid ]] ; then
while read Line
do
process_video $Line
done < $vid
else
process_video $vid
fi
break
;;
"Quit")
break
;;
*) echo invalid option;;
esac
done
这是脚本给我所有结束的错误
startdl.sh: line 57: ac: command not found
startdl.sh: line 58: syntax error near unexpected token `done'
startdl.sh: line 58: `done'
答案 0 :(得分:0)
尝试:
*) echo "invalid option"
;;