Skip to content

Instantly share code, notes, and snippets.

@ramiro
Created March 22, 2018 19:51
Show Gist options
  • Save ramiro/2096bafc34bb3ec4accb130a67864a2a to your computer and use it in GitHub Desktop.
Save ramiro/2096bafc34bb3ec4accb130a67864a2a to your computer and use it in GitHub Desktop.
#!/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