title: Unable to mute unzip output in script
body: <p>I wrote a script that unzips certificates from zips and tests the certs against one of our servers:</p>
  
  <pre><code>#!/bin/bash
  WORKINGDIR=$(pwd)
  if [ ! -f ./users.zip ]; then
      echo "users.zip not found. Exiting."
      exit 1
          else 
              unzip users.zip -d users
              echo "users.zip extracted."
  fi
  cd ./users/client
  
  echo "Extracting files..."
  for file in `ls *.zip`; do 
      unzip -j $file -d `echo $file | cut -d . -f 1` &amp;&gt; /dev/null
  done
  echo "name,result" &gt; $WORKINGDIR/results.csv
  i=0 # Total counter
  j=0 # Working counter
  k=0 # Failed counter
  for D in `ls -d */`; do
          cd "$D"
          SHORT=`find *.p12 | cut -f1 -d "."`
          openssl pkcs12 -in `echo $SHORT".p12"` -passin file:./password -passout pass:testpass -out `echo $SHORT".pem"` &amp;&gt; /dev/null
          echo "Trying: "$SHORT
          ((i++))
          curl --cert ./`echo $SHORT".pem"`:testpass https://example.com -k &amp;&gt; /dev/null
          OUT=$?
          if [ $OUT -eq 0 ];then
                      ((j++)) ; echo -e $(tput setaf 2)"\t"$SHORT": OK $(tput sgr0)" ; echo $SHORT",OK" &gt;&gt; $WORKINGDIR/results.csv
                  else
                      ((k++)) ; echo -e $(tput setaf 1)"\t"$SHORT": FAILED $(tput sgr0)" ; echo $SHORT",FAILED" &gt;&gt; $WORKINGDIR/results.csv
          fi
          rm `echo $SHORT".pem"`
          cd ..
  done
  echo "Test complete:"
  echo "Tested: "$i
  echo "Working: "$j
  echo "Failed: "$k
  echo "Results saved to "$WORKINGDIR"/results.csv"
  exit 0
  </code></pre>
  
  <p>When it gets to the unzipping part I always get this output:</p>
  
  <pre><code>Archive:  users.zip
     creating: users/keys/
    inflating: users/keys/user1.zip
    inflating: users/keys/user2.zip
    inflating: users/keys/user3.zip
    inflating: users/keys/user4.zip
    inflating: users/keys/user5.zip
    inflating: users/keys/user6.zip
    inflating: users/keys/user7.zip
    inflating: users/keys/user8.zip
    inflating: users/keys/user9.zip
    inflating: users/keys/user10.zip
    inflating: users/keys/user11.zip
  </code></pre>
  
  <p>I've tried to pipe the output to /dev/null in different ways:
      <code>&amp;&gt; /dev/null</code>
      <code>1&gt;&amp;- 2&gt;&amp;-</code>
      <code>2&gt;&amp;1</code>
      etc.
  Nothing works. What's weird is that if I put just the unzipping part of the script into a separate script file:</p>
  
  <pre><code>#!/bin/bash
  for file in `ls *.zip`; do
          unzip -j $file -d `echo $file | cut -d . -f 1` &amp;&gt; /dev/null
  done
  </code></pre>
  
  <p>It works no problem. Any thought on why this is happening?</p>