Get your server issues fixed by our experts for a price starting at just 25 USD/Hour. Click here to register and open a ticket with us now!

Author Topic: esac in shell scripting  (Read 11961 times)

0 Members and 1 Guest are viewing this topic.

arunlalpr

  • Newbie
  • *
  • Posts: 14
  • Karma: +0/-0
esac in shell scripting
« on: December 18, 2018, 10:29:08 am »
esac in shell scripting

Like fi for if. esac is the spell backward of "case".


===================

#!/bin/sh

FRUIT="kiwi"

case "$FRUIT" in
   "apple") echo "Apple pie is quite tasty."
   ;;
   "banana") echo "I like banana nut bread."
   ;;
   "kiwi") echo "New Zealand is famous for kiwi."
   ;;
esac


==========================

Happy scripting.