find command not working in script but works fine from command prompt
by unixhelp20201 from LinuxQuestions.org on (#51WVV)
I have a script where I am trying to find files for a specific time frame which I can grep for a specific text, script works fine from command line but not from script.
Check_Start_Date=`TZ=GMT+24 date +%Y-%m-%d`
Check_Stop_Date=`date +%Y-%m-%d`
Check_Start_Time="22:55:00"
Check_Stop_Time="07:00:00"
export Check_Start_Date
export Check_Stop_Date
export Check_Start_Time
export Check_Stop_Time
grep -i "Job ended with failure" find '/usage1/prlocal/oper/var/dbl/log/' -type f -newermt "${Check_Start_Date} ${Check_Start_Time}" \! -newermt "${Check_Stop_Date} ${Check_Stop_Time}"` | awk -F _ '{print $1}' >Jobs_Failed_${Check_Start_Date}.tmp1
when run from script it gives the below error:
: not found [No such file or directory]
: not found [No such file or directory]
: not found [No such file or directory]
: is not an identifierOME_DIR


Check_Start_Date=`TZ=GMT+24 date +%Y-%m-%d`
Check_Stop_Date=`date +%Y-%m-%d`
Check_Start_Time="22:55:00"
Check_Stop_Time="07:00:00"
export Check_Start_Date
export Check_Stop_Date
export Check_Start_Time
export Check_Stop_Time
grep -i "Job ended with failure" find '/usage1/prlocal/oper/var/dbl/log/' -type f -newermt "${Check_Start_Date} ${Check_Start_Time}" \! -newermt "${Check_Stop_Date} ${Check_Stop_Time}"` | awk -F _ '{print $1}' >Jobs_Failed_${Check_Start_Date}.tmp1
when run from script it gives the below error:
: not found [No such file or directory]
: not found [No such file or directory]
: not found [No such file or directory]
: is not an identifierOME_DIR