When a batch file goes through some window-compatible editors or other failures, it may happen that carriage returns are added to the end of the line (just before the line)
so all lines, for example, are:
php /var/www/mysite/script1.php
contains an invisible \r char, which is interpreted as part of the py argument php => file /var/www/mysite/script1.php<invisible char> not found.
Follow these steps:
dos2unix update.sh > newbatchfile.sh
or
tr -d "\015" < update.sh > newbatchfile.sh
(compare file sizes, if newbatch file size is smaller, the problem was CR-characters and fixed)
Jean-François Fabre
source share