title: Terminal opens then instantly closes
body: <p>So I have the following code (W.I.P) and when I try to execute it, the Terminal instantly opens and closes again. I'm not quite sure what is causing it so I would appreciate if anyone could help me out. Code is below:</p>
  
  <pre><code>#!/bin/bash
  
  #displays a menu with options for user to select
  showMenu () 
  
  {
  
  zenity --list \
  --title="Menu - Choose an option" \
  --column="Option No." --column="Option" \
  --height="300" --width="475" \
  1 "Install Gnome Disk Utility &amp; gParted" \
  2 "Create File - Demo.txt" \
  3 "Remove File - Demo.txt" \
  4 "Search for "BASH" in the .profile file (Case insensitive)" \
  5 "Exit" 
  
  }
  
  while [ 1 ]
  do
  
  CHOICE="$(showMenu)"
  case $CHOICE in
  "1")
      #gets and installs gnome disk utility and gparted
      sudo apt-get install gnome-disk-utility
      sudo apt-get install gparted
      ;;
  "2")
      #creates a blank text file on the desktop called            Demo.txt
      touch /home/admin/Desktop/Demo.txt
      zenity --info \
      --text="File Demo.txt created on Desktop" \
      ;;
  "3")
      zenity --question \
      --text="Are you sure you want to remove Demo.txt?" \
      if ["$?" = 0]
      then
      #removes the Demo.txt file from the desktop
      rm /home/admin/Desktop/Demo.txt
  
      zenity --info \
      --text="File has been removed" \
      ;;
  "4")
      #searches the .profile file for the word 'BASH' (Not case           sensitive)
      grep -i "BASH" /home/mintuser/.profile
      ;;
  "5")
      echo "Are you sure you want to exit? Press y/n"
      read YN
      case "$YN" in
  "y")
      exit
      ;;
  "n")
      #command for 'ESC' in BASH. Clears the screen
      printf "\ec"
      ;;
  *)
      echo "Invalid option"
      ;;
  esac
  done
  </code></pre>
  
  <p>I have a command line version of the script working but it's when I've went to use Zenity widgets to create a GUI that the problem has occurred. Thanks for reading and any help I may receive.</p>