I created a bash script that ran fine for awhile on a nightly crontab but then started crashing with commands not found, so I added
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/home/homedir/scripts/myscriptdir
export PATH
and now I don't get those errors, but a while loop is crashing with
line 23: [: : integer expression expected]
for
a=`tail -n +2 newupdate | head -1 | cut -c44-47`
b=`tail -n +2 lastupdate | head -1 | cut -c44-47`
c=`tail -n +2 newupdate | head -1 | cut -c50-57`
while [ "$a" -ne "$b" ]; do
if I cd'ed to the /home/homedir/scripts/myscriptdir in the top of my script, is this just a path issue for finding file=newupdate without absolute path, or shouldn't my PATH be correct now that I exported it in the script? Otherwise, why is it breaking?