When I run this mail command from the terminal, there's no problems:
mail -s "Test Mail" firstname.lastname@example.org < home/user/example.txt
When I add it to a bash script that mainly does this, there's no problems:
tmpString=$(ssh user@server `perl -s` < /home/user/perlscript.pl 2> errorfile.txt) mail -s "Test Mail" email@example.com < home/user/example.txt
But, when I create a crontab to run the bash script, the mail never gets sent:
10 14 * * * /home/user/mybashscript
However, I do recieve an email from cronjob about the output. The email with the subject "Test Mail" never arrives.
Anyone had this issue before?
Ok, I'll just change some of personal related naming. The mail should be sent before the last echo, but it's not showing up in the trace?
+ . /home/user/.bashrc ++ PS1=`\u@\h \w$` ++ TERM=vt100 ++PATH=/usr/sbin:/usr/bin:/bin ++ ssh user@example `perl -s` + scriptString=`$VAR` = ``\``Build was OK`\``;` +echo `$VAR1`= ``\``Build was OK`\``;` $VAR1 = `Build was OK`; + [[ $VAR1 = `Build was OK`; == *\B\u\i\l\d\ \f\a\i\l\e\d* ]] + echo