Okay. I've been banging my head up against the Linux wall again. What am I doing incorrectly here:
#! /bin/bash
echo
echo "1. Windows (Microsoft)
echo 2. Linux (Red Hat)
echo 3. MacOS (Apple)
echo
echo -n Select your OS choice [1, 2 or 3]: "
READ OS
echo
if [ "$OS" -eq 1 ]; then
echo "You picked Windows (Microsoft)."
fi
if [ "$OS" -eq 2 ];
echo "You picked Linux (Red Hat)."
fi
if [ "$OS" -eq 3 ]; then
echo "You picked MacOS (Apple)."
fi
if [ "$OS" > 3 || "$OS" < 1 ]];
echo "Invalid selection!"
fi
exit 1
Aucun commentaire:
Enregistrer un commentaire