title: Unzip .gz file to /tmp location and delete unipped .gz file after the task
body: <p>My script as follows for reading file line by line,</p>
  
  <pre><code>file= "/c/User/XXX/Desktop/XYZ.log" 
  while IFS= read -r line
  do
      if echo $line | grep  -Eq 'something' ; then
  
        [ do these tasks ]
  
  
      # define the log directory
      log_dir=/c/Users/xxxxx/Desktop/Logs/"$DIR"/read_log
  
      # define the log file for this month
      log_file="$log_dir/rlog-$(date +%Y-%m)"
  
      # Create the log directory.
      if [ ! -d "$log_dir" ]; then
             mkdir -p "$log_dir" ||
                     die "failed to create log directory $log_dir"
      fi
  
      echo "variable" &gt;&gt; "$log_file"
  
      fi  
  done &lt;"$file"
  </code></pre>
  
  <p>Actually the file I am supposed to read is .gz file consists 
  of single big file in it is located at some path /x/y/z. I want to know how to unzip this file to particular location /tmp and delete it at the end. I want to add unzip and delete tasks to my lines of code.</p>
  
  <p>Thank you</p>