title: How to put / use dialog in an already constructed bash scode
body: <p>I have a source code written in bash and i need to use dialog to create terminal GUI. My  bash code have menu and sub-menu's.
  i have this code and i tried to use dialog but when i tried to select from the main menu nothing happened/happens.</p>
  
  <pre><code>INPUT=/tmp/projekt.txt
  while true ;do #a loop so this list will be used again, until the user presses x button
  
  dialog --backtitle "Welcome to MY utility" --title"======MAINMENU======="    --menu "Choices:" 20 50 10 \
   "A." " File operations" \
   "B." "Directory operations" \
   "C." " Process management" \
   "D." "Search operations" \
   "X." "Exit the program" 2&gt;"${INPUT}"
  
  choice=$(&lt;"${INPUT}")
  
  case $choice in
  
      Adialog --title "File operations" --menu "Choices:" 20 50 10 \
       "A." "Copy file" \
       "B." "Rename file" \
       "C." "Remove file" \
       "D." "Edit file" \
       "E." "Print file" \
       "X." "Return to main menu" 2&gt;"${INPUT}" 
      choiceA=$(&lt;"${INPUT}")
  
  
          case $choiceA in
  
              a)
              #a place for the functions
              functionAA
              ;;
  
              b)
              functionAB
              ;;
  
              c)
              functionAC
              ;;
  
              d)
              functionAD
              ;;
  
              e)
              functionAE
              ;;
  
              x)
              --infobox "Returning to main menu" 10 13; sleep 3; clear;; 
              ;;
  
                              *)
                              echo
                              echo -e "\e[91mNo option was reconized\e[0m" #Light red color, not exactly the same$
              echo
              echo "Returning to main menu"
  
  
          esac
          #done
  
      ;;
  </code></pre>