#!/usr/bin/env bash OLDIFS=$IFS IFS=" " for i in $*; do STDOUT=`/usr/bin/shred -z -f -n 7 -u "${i}" 2>&1` ERR=`echo $STDOUT | cut -d: -f4` if (echo "${STDOUT}" | grep "failed" ); then zenity --error --title "File Shredder Error" --text "${ERR} while attempting to shred the file: ${i}" fi done