title: Display file name of all files with certain extension
body: <p>What I want is for the user to select a file from anywhere using zenity, and the script will detect the file extension, for example (.tar.gz) or (.zip), and perform actions on them accordingly. Here's an example.</p>
  
  <pre><code>#! /bin/bash
  
  FILE=$(zenity --file-selection --title="Select a file to check")
  echo "File: $FILE"
  
  if [ "$FILE" = "*.zip" ] 
  then
      echo "File that is a .zip found"
      FILENAMENOEXT="${FILE%.*}"
      echo "Filename with extention $FILENAMENOEXT"
      #Perform xx action to $FILE if it is a zip
  
  elif [ "$FILE" = "*.tar.gz" ]
  then
  echo "File is a .tar.gz found"
  FILENAMENOEXT="${FILE%.tar.*}"
  echo "Filename with extention $FILENAMENOEXT"
  #Perform xx action to $FILE if it is a t.tar.gz
  
  else
      echo "File is neither .zip nor .tar.gz"
  fi
  
  echo "test $FILENAMENOEXT"
  </code></pre>