Afficher un message
Vieux 19/09/2006, 02h50   #6
John Kelly
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: mailutil and passwords?

On Sat, 16 Sep 2006 16:56:00 +0100, John Kelly <jak@isp2dial.com>
wrote:

> .... 2>&1 | grep -v '^password: password:'


>That's why I redirect stderr to the "grep -v" pipe, filtering out the
>password prompts and suppressing the mail on a successful run. Any
>other stderr output, such as command failure, will be passed though by
>grep, and produce a mail.


There is a bug in that grep. I assumed error messages would start on
a new line, but that is not true. Here is the fix:

grep -v '^[[:space:]]*password:[[:space:]]*$'

And when I fixed that, then I discovered a warning message from the
server, that I didn't want mails for. So here is the next version:

grep -v 'hasnoatt\|^[[:space:]]*password:[[:space:]]*$'

I may be the only living person who cares about this, but for anyone
who finds this thread in an archaeological dig a thousand years from
now, you may have to tinker with the grep to get it working the way
you want. :-)


  Réponse avec citation
 
Page generated in 0,05036 seconds with 9 queries