0
#!/bin/sh
#
TEMP_FILE=/home/eceadcb/Test_Directory_5/temp.txt

echo "ABC" >> ${TEMP_FILE}
for i in $(<Active_cms.txt)
do
    echo "ABC1" >> ${TEMP_FILE}
    echo "$i" >> ${TEMP_FILE}
done

When I run this script manually, it runs just fine. But when I schedule it in crontab, only ABC goes in the TEMP_FILE and nothing from loop gets into the file.

0 Answers0