Writing a custom Shell Script for a college assignment. Have practically everything working apart from this.... I have an alias called ifc which will call a function called functionIfc. However, when this code is used, it tells me that unexpected token '}' is found. Cannot seem to be able to debug this. Been stuck on it for a while. Any help would be greatly appreciated!
alias ifc="functionIfc";
functionIfc(){
echo "Please enter which ethernet you would like to display"
echo -e "\n Command ifc1: Shows loopback"
echo -e "\n Command ifc2: Shows eth 0"
echo -e "\n Command ifc3 Shows eth 1"
echo -e "\n Command ifc4 shows eth 2"
echo -e "\n Command ifc5 shows eth 3"
read INPUT
if [ $(INPUT) == "ifc1" ]; then
echo $(ip addr show lo)
else if [ $(INPUT) == "ifc2" ]; then
echo $(ip addr show eth0)
else if [ $(INPUT) == "ifc3" ]; then
echo $(ip addr show eth1)
else if [ $(INPUT) == "ifc4" ]; then
echo $(ip addr show eth2)
else if [ $(INPUT) == "ifc5" ]; then
echo $(ip addr show eth3)
else
echo Not a valid entry, Try again
fi
}