0
votes

the script works but I do not understand it when the script has finished the error appears

is my big code with a syntax error near unexpected token `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

this is the error that the script gives me all the end

startdl.sh: line 57: ac: command not found
startdl.sh: line 58: syntax error near unexpected token `done'
startdl.sh: line 58: `done'
1
Did you try erasing and retyping the "esac"? - Ignacio Vazquez-Abrams
Are there spaces in front of the #!/bin/bash? - Keith Thompson

1 Answers

0
votes

Try:

*) echo "invalid option"
;;