I have a crontab which executes a shell script and if there is output I expect to see the output in my e-mail:
Here is what the crontab entry looks like:
*/2 * * * * /bin/check_perms.sh
The actual script looks like:
#!/bin/bash
declare -a fix_dirs
fix_dirs=(`cat $(dirname $0)/dirs_to_fix.txt`)
for dir in "${fix_dirs[@]}"; do
find $dir -type d ! -perm -go=xw -exec stat -c '%U %n %A' {} +
find $dir -type f ! -perm -go=w -exec stat -c '%U %n %A' {} +
done
I am guessing the output of the find is the problem, but if I redirect to a file the file has newlines. When I get the email from cron it is missing all the newlines between files returned by find.
UPDATE: It was just a mail client “issue” I found a way to disable Outlook’s behavior here: http://support.microsoft.com/kb/287816
Most likely your email client is removing the newlines. Try looking at the message source in your email client.