意外令牌“完成”附近的语法错误语法错误

时间:2014-10-09 03:24:23

标签: linux bash shell

脚本可以正常运行,但是当脚本完成错误时我不明白

是我的大代码,语法错误接近意外令牌`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'

1 个答案:

答案 0 :(得分:0)

尝试:

*) echo "invalid option"
;;