Sending Mail

Hi All,

I have a script that looks like this:

***********

#!/bin/sh -x
cd /u01/app/oracle/diag/rdbms/spdb/spdb/trace
cat alert_spdb.log|grep Archiver >/dev/null
if [ $? -eq 0 ];
then
mailx -s "Archiver message in Alert log" user@email.com
fi

************

Im using the -x option to see any issues.
It simply hangs at the mailx line and doesn't proceed any further...

any thing Im doing wrong with this?

thanks

You are not providing any input to mailx.

echo "Archiver message in Alert log" | mailx -s "Archiver message in Alert log" user@email.com

or

mailx -s "Archiver message in Alert log" user@email.com < msg_file