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?
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.