Problems with Echo command

Hi there im having a problem with an echo command and have been trying to fix it for a little while now but just cant seem to see the issue. The code is as follows:

#!/bin/bash
#Filename: Assignment Author: Luke Francis
echo "OPERATOR ADMINISTRATIVE TOOL"
echo "Please enter your password:"
read password
  if [ $password -eq 0600519 ]
          then
          clear
              echo "1. User Information"
               echo "2. Network Connectivity"
                echo "3. Processes"
                 echo "4. System Information"
                  echo "5. Hardware Utilization"
                   echo "Which option do you require?"
read menunumber
  if [ $menunumber -eq 1 ]
               then
                   clear
                           echo "USER INFORMATION"
                            echo "1. Registered Users"
                             echo "2. Disk Usage"
                              echo "3. Last Logins"
                              echo "Which option do you require?"
read menunumber2
  if [ $menunumber2 -eq 1 ]
               then
                     awk -F:  '{print $1}' /etc/passwd
  elif [ $menunumber2 -eq 2 ]
               then
                      du
  elif [ $menunumber2 -eq 3 ]
               then
                      who
        else
            echo "INCORRECT PASSWORD"
               fi
                    fi
                        fi
                            echo "Thank you for using the Operator Administrative Tool."
read menunumber
  if [ $menunumber -eq 2 ]
              then
                  clear
                        echo "

The problem im having is it seems as though when the program is run and an incorrect password entered, the echo command warning the user of incorrect password is skipped so instead of it saying INCORRECT PASSWORD with Thank you for using the Operator Administrative Tool underneath it only displays the thank you line. If someone could please point out where im going wrong i'd be most grateful because its had me puzzled for a while im relatively new to this. thanks.

try placing your else block after ending 2 if blocks

#!/bin/bash
#Filename: Assignment Author: Luke Francis
echo "OPERATOR ADMINISTRATIVE TOOL"
echo "Please enter your password:"
read password
if [ $password -eq 0600519 ]
then
clear
echo "1. User Information"
echo "2. Network Connectivity"
echo "3. Processes"
echo "4. System Information"
echo "5. Hardware Utilization"
echo "Which option do you require?"
read menunumber
if [ $menunumber -eq 1 ]
then
clear
echo "USER INFORMATION"
echo "1. Registered Users"
echo "2. Disk Usage"
echo "3. Last Logins"
echo "Which option do you require?"
read menunumber2
if [ $menunumber2 -eq 1 ]
then
awk -F: '{print $1}' /etc/passwd
elif [ $menunumber2 -eq 2 ]
then
du
elif [ $menunumber2 -eq 3 ]
then
who
fi
fi
else
echo "INCORRECT PASSWORD"fi
echo "Thank you for using the Operator Administrative Tool."
read menunumber
if [ $menunumber -eq 2 ]
then
clear
echo "

Thanks for the help vidyadhar85, i should have included this earlier i have tried this but but get faced with the following:

OPERATOR ADMINISTRATIVE TOOL
Please enter your password:
232
INCORRECT PASSWORD
Thank you for using the Operator Administrative Tool.

./Assignment: line 44: unexpected EOF while looking for matching `"'
./Assignment: line 45: syntax error: unexpected end of file

That is how i want the output to be though, minus the two syntax error lines lol, any ideas on how i can ammend that

one extra backquote is there and last if statement doesn't have fi so check yourself you will find it

Thanks alot it works fine now :slight_smile: