0

I have a broblem with bash script. I want to go back to menu but have an error from terminal "unexpected end of file"

#!/bin/bash 
users=$(awk -F'[/:]' '{if ($3 >= 1000 && $3 != 65534) print $1}' /etc/passwd)
menu(){
ans=$(zenity  --list  --text "Izvēlies funkciju" --radiolist  --column "Pick" --column "" TRUE "Lietotāju saraksts" False "Pievienot jaunu lietotāju" FALSE "Dzēst lietotāju" FALSE "Aktivizēt lietotāju" FALSE "Deaktivizēt lietotāju");
}
menu

if [ "$ans" = "Lietotāju saraksts" ]; then

 zenity --info --text=$users else

    if [ $? == '0' ]; then
menu

fi
0

The following line

zenity --info --text=$users else

sends else as a parameter to zenity. You need a semicolon or newline before else.

You'll need another fi to close the outer if, too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.