I have the following sell code
#!/bin/sh
echo "hello"
echo "enter the salutation $abc"
read -r abc
if [ "$abc" = "1" ]
then
echo "Hiiii"
elif [ "$abc" = "2" ]
then
echo "haaaaa"
fi
echo "enter name $xyz"
read -r xyz
if
if [ "$xyz" = "1" ]
then
echo "Chris"
elif [ "$xyz" = "2" ]
then
echo "Morris"
fi
echo "you had put salutation as" "$abc"
echo "you entered name as " "$xyz"
I need the final printing to be like
you had put salutation as Hii
you entered name as chris
what I get is
you had put salutation as 1
you entered name as 1
Any help? Do I need to mention the final statement inside the if elif statement?
salutationandnamerespectively?test.sh: line 24: syntax error: unexpected end of file. Won't produce the output you said you saw.