I'm coding a nestedif program as shown below but there is a syntax error that says "Syntax error: "then" unexpected (expecting "fi")
#!bin/sh
choose=0
echo "Do you want to choose a color?"
read choose
if [ $choose == "Y" ] ; then
echo "1. Blue"
echo "2. Green"
echo -n "Select your choice [1 or 2]? "
read choice
if [ $choice == "1" ] ; then
echo "you chose blue"
else [ $choice == "2" ] ; then
echo "you chose green"
fi
else
echo " invalid choice"
fi
I expect it to be if i choose 1 the output will be blue then if i choose 2 the output will be green else invalid choice
if [ "$choose" == "Y" ] ; then .... (3) Indent your code consistently.case "{choice}" in ... esac.echo 'invalid choice' >&2#!/bin/shinstead of#!bin/sh