Page 1 of 1

script executed in a cron job - best way to format ?

Posted: Fri Dec 18, 2009 8:53 pm
by mih
Hello,

I have a php script that I was executing online and that contains lots of echo '<br>'.
Now executing it as a cron job the output of course contains '<br>'

It looks something like

Code: Select all

<br>Total = 1<br>Inserted = 0<br>Updated = 0<br>Deleted = 1<br>Item ID not found = 0<br><br>Folder: sda<br />
What's the proper way to format and nicely have results one after each other ?

Re: script executed in a cron job - best way to format ?

Posted: Fri Dec 18, 2009 9:50 pm
by requinix
Echo <br>\n instead of just <br>.

Or if this is strictly for cron output, just a \n.

Re: script executed in a cron job - best way to format ?

Posted: Sun Dec 20, 2009 3:51 pm
by mih
Thank you again !

I also learned the hard way that

Code: Select all

echo '<br>\n';
will not go to the next line but I have to use

Code: Select all

echo "<br>\n"