Created
March 22, 2018 19:51
-
-
Save ramiro/2096bafc34bb3ec4accb130a67864a2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MAILQ=/opt/zimbra/common/sbin/mailq | |
POSTSUPER=/opt/zimbra/common/sbin/postsuper | |
if test $# -ne 1; then | |
echo Uso: | |
echo $(basename $0) destinatario | |
echo Ejemplo: | |
echo $(basename $0) [email protected] | |
exit 1 | |
fi | |
DEST=$1 | |
# TODO: Lograr que el print $1 del script awk imprima el $1 de awk y no el 1er. argumento del script bash | |
$MAILQ | grep -v '^ *(' | awk 'BEGIN { RS = "" } { if ($8 == "$DEST" && $9 == "") print $1}' | tr -d '*!' | $POSTSUPER -h - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment