admin管理员组

文章数量:1023047

I have a simple korn shell script which will send sms to me whenever my database hits some error. I have a scheduler jobs which execute a store_proc to check the alert logs then trigger this shell script whenever there's any critical error occured.

Here's how's the scripts are written.

> #!/bin/ksh
> 
> export ORACLE_HOME=/opt/app/oracle/product/19.3.0/dbhome_1 export
> ORACLE_SID=$1 export PATH=$PATH:$ORACLE_HOME/bin
> SMS_SENT=/tmp/ods_sms.txt echo `date` >> $SMS_SENT
> 
> 
> /bin/mail -s "ALERT :$1 ${2}" +phone_number < /dev/null

Script was given execute permission

ls -ltr send_sms.ksh
-rwxr-x--- 1 oracle oinstall 261 Nov  5 15:53 send_sms.ksh

If I were to execute this script directly in the folder it works. However in my store prod, I'm calling this script from it's full path & it's giving me No such file or directory error.

./home/oracle/monitor/send_sms.ksh
-bash: ./home/oracle/monitor/send_sms.ksh: No such file or directory

What am I missing here?

I have a simple korn shell script which will send sms to me whenever my database hits some error. I have a scheduler jobs which execute a store_proc to check the alert logs then trigger this shell script whenever there's any critical error occured.

Here's how's the scripts are written.

> #!/bin/ksh
> 
> export ORACLE_HOME=/opt/app/oracle/product/19.3.0/dbhome_1 export
> ORACLE_SID=$1 export PATH=$PATH:$ORACLE_HOME/bin
> SMS_SENT=/tmp/ods_sms.txt echo `date` >> $SMS_SENT
> 
> 
> /bin/mail -s "ALERT :$1 ${2}" +phone_number < /dev/null

Script was given execute permission

ls -ltr send_sms.ksh
-rwxr-x--- 1 oracle oinstall 261 Nov  5 15:53 send_sms.ksh

If I were to execute this script directly in the folder it works. However in my store prod, I'm calling this script from it's full path & it's giving me No such file or directory error.

./home/oracle/monitor/send_sms.ksh
-bash: ./home/oracle/monitor/send_sms.ksh: No such file or directory

What am I missing here?

本文标签: linuxShell script unable to execute using full pathStack Overflow