![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| unable to exit from a shell script | Sreejith_VK | Shell Programming and Scripting | 2 | 05-30-2008 04:29 AM |
| Unable to use sort command in Shell Script | racbern | Shell Programming and Scripting | 1 | 04-04-2008 06:25 AM |
| How to read email using mailx in shell script or perl | jliharper | Shell Programming and Scripting | 4 | 03-23-2008 06:57 AM |
| Mailx in shell script (KSH) | rockysfr | Shell Programming and Scripting | 2 | 07-01-2007 07:08 AM |
| How to use mail,mailx command in Shell Script ? | sollin | Shell Programming and Scripting | 16 | 04-28-2006 07:50 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
unable to do mailx from shell script
Hi
From within a shell script my mailx doesnt seem to work...can somebody tell me what is wrong... #!/bin/ksh #Script to verify wheather all databases listed are up and running #Script works with Oracle8 and above databases #Script has to be run by ./scriptname DBA=xiamin@unix.com echo $DBA PLATFORM=`uname` if [ ${PLATFORM} != "SunOS" ]; then ORATAB="/etc/oratab" #Digital Unix else ORATAB="/var/opt/oracle/oratab" #SunOS fi ALL_DATABASES=`cat $ORATAB|grep -v "^#"|grep -v "N$"|cut -f1 -d: -s` for DB in $ALL_DATABASES do unset TWO_TASK export ORACLE_SID=$DB echo $ORACLE_SID export ORACLE_HOME=`grep "^${DB}:" $ORATAB|cut -d: -f2 -s` echo $ORACLE_HOME export PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib; echo "---> Database $ORACLE_SID, using home $ORACLE_HOME" STATUS=`sqlplus -s system/manager <<EOF set pagesize 0 feedback off verify off heading off echo off select status from v\\$instance; exit; EOF` if [[ $STATUS = "OPEN" ]]; then echo "Dude Database $ORACLE_SID on `uname -n` is Down check it " \ >>/tmp/db_status.log fi done echo $PATH if [[ -s $db_status.log ]]; then mailx -s "Database status from `uname -n`" $DBA <db_status.log fi it does not mail me the file db_status.log at all..whereas from the command prompt using mailx i can send mails to myslef.. regards xiamin |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|