I'm not a wizard with grep+sed+awk :-)
Thank you a lot for your precious advice.
-F



-----Messaggio originale-----
Da: owner-postfix-us...@postfix.org [mailto:owner-postfix-us...@postfix.org]
Per conto di Wietse Venema
Inviato: giovedì 9 giugno 2016 17:19
A: Postfix users <postfix-users@postfix.org>
Oggetto: Re: R: Un-hold only some messages and not all the queue

i...@itrezero.it:
> Thank you a lot Mr. Venema!!!
>
> Et voila my little script for un-holding just n (n=100 in the example) 
> and moving to deferred:
>
> postqueue -p | pcregrep -M "[0-9A-Z]{10}" | awk '{print $1;}' | sed
's/.$//'
> | head -100 | postsuper -H -

Caution:

1) The regular expression should be anchored to the beginning of the line.

2) The regular expression should select only queue IDs with a '!'.

3) With "enable_long_queue_ids=yes" queue IDs may contain lowercase
characters.

4) "grep | awk | sed" can be done with awk alone.

Example:

awk '/^[0-9A-Za-z]+!/ { print substr($1, 1, length($1) - 1) }'

        Wietse


---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus

Reply via email to