Hi
One shell script is running fine when I am running it through command line.
However the same thing is not working when I am trying through cron.
Basically when I debugged I found when I am running it throuh ssh terminal ( putty) it's getting loading the profile file properly but through cron it's not doing the same.
Example
Code:
#!/bin/bash
. ~xcrukusr/.bash_profile_xcruk
. $XCR_HOME/cfg/.setxcrenv
. $XCR_CFG/.email_list
##-----------------------------
#debug
echo $HOME
echo "XCR Home: $XCR_HOME"
echo "XCR cfg: $XCR_CFG"
echo "$XCR_HOME/cfg/.setxcrenv"
echo "$XCR_CFG/.email_list"
output: ( through putty)
/home/xcrukusr
XCR Home: /idvprddata/xcrukusr
XCR cfg: /idvprddata/xcrukusr/cfg
/idvprddata/xcrukusr/cfg/.setxcrenv
/idvprddata/xcrukusr/cfg/.email_list
Output:(in cron)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX: line 3: /cfg/.setxcrenv: No such file or directory
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX: line 4: /.email_list: No such file or directory
/home/xcrukusr
XCR Home:
XCR cfg:
/cfg/.setxcrenv
/.email_list
what could be the possible reason?
Here is content of .bash_profile_xcruk
# .bash_profile_xcruk
PATH=$PATH:$HOME/bin
export PS1="[\u@\h:\w \t $]"
export XCR_HOME=/idvprddata/xcrukusr
alias ptree="ps axjf"
alias pt="ps -ejH"