I have a cron job that runs several shell scripts:
30 1 * * 1-5 /ufs/00/home/usr/bin/ConsentforFoo.sh "prd"
15 1 * * 1-5 /ufs/00/home/usr/bin/apptTvoxforFoo.sh
the first shell script looks like this:
#!/bin/bash
# ConsentforFoo.sh - set different environments, set path to perl scripts, calls script
TMP_HOME=/home/localweb/htdocs/cgi-bin/usr/CFoodir
if [ "$1" = "dev" ] || [ "$1" = "uat" ] || [ "$1" = "prd" ]
then
cd $TMP_HOME/$1
My-Consent-Cron.pl
else
echo "Val Not Set: $1"
fi
this script works flawlessly... However, the second shell script looks like this:
#!/bin/bash
# apptTvoxforFoo.sh - sends MHT population and patients with multiple appointments to west
TMP_HOME=/home/localweb/htdocs/cgi-bin/usr/CFoodir
cd $TMP_HOME
TvoxCron.pl #adding './' works here
but when it runs, I get an error saying: "sh: /ufs/00/home/usr/bin/apptTvoxforFoo.sh: cannot execute"
I add a "pwd" to the shell script and it's getting in the right directory and the file is there...
Weirdest thing is when I add "./" to it, it works... but in the first shell script I don't have to...
Any ideas why taking the if/then/else out would force me to SOURCE the perl script?
Thanks for any help you can provide.
./script.plis not "sourcing" the script, it's just calling it from a relative path.