Unable to mute unzip output in script Unable to mute unzip output in script bash bash

Unable to mute unzip output in script


The /dev/null behavior is really odd. It’s probably better to just use unzip’s -q (quiet) option.


I figured it out and feel like quite the simpleton.

I was getting the output from the first time I call unzip:

unzip users.zip -d users

and not from the loop:

for file in `ls *.zip`; do     unzip -j $file -d `echo $file | cut -d . -f 1` &> /dev/nulldone

I added -qq to the first unzip:

unzip -qq users.zip -d users

and it works as expected.


In the script you posted there is no redirection for users.zip specifically.

unzip users.zip -d users