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
版权声明:本文标题:linux - Shell script unable to execute using full path - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745578091a2157142.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论