mercredi 16 décembre 2015

Unix Shell Scripting ifelse error

Please help, This script gives following error while executing :

Then unexpected Str1 not found Str2 not found

#!/bin/ksh 

echo ">>Please press y or n :"
read Str

Str1="y"
Str2="n"
if[[$Str1 == $Str]];then
echo "You pressed Y."
elif[[$Str2 == $Str]]; then
echo "You pressed N."
else
echo "Error."
fi

Aucun commentaire:

Enregistrer un commentaire