if sh code example
Example 1: if sh
#!/bin/sh
echo -n "Qual'è il nome di Garibaldi? "
read RISPOSTA
if [ ${RISPOSTA} = "giuseppe" ]
then
echo "Risposta esatta"
else
echo "Risposta sbagliata"
fi
Example 2: fi bash
if [ ! -x /usr/bin/axel ]
then echo "axel is not installed, perform this?(y/n)"
read ops
case $ops in
y) if apt-get install axel -y --force-yes
then echo "axel installed"
else echo "unable to install the axel. you are using sudo?" ; exit
fi ;;
n) echo "not possible usage apt-fast" ; exit ;;
esac
fi