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.
