Hi. I have created a script that works perfect but I am now told that I could have done it better, but how?
This is an example of how I did mine:
#!/bin/bash
#
function users
{
echo "1. Password file"
echo
echo "Enter num: "
read usernumber
if [ $usernumber -eq 1 ]
then
cat /etc/passwd
else if [ $usernumber -eq 2 ]
then
cat etc/passwd
fi
fi
I have been told that I shouldn't have done it using else if but what other ways are there of doing it?
Thanks