Article 5Q9EJ [SOLVED] [sSMTP] Right way for newline in body?

[SOLVED] [sSMTP] Right way for newline in body?

by
littlebigman
from LinuxQuestions.org on (#5Q9EJ)
Hello,

I'm using the following code to send an email once a week through CRON to check free disk space on a host.

For some reason, the body is either a bit messy, or empty altogether:

Code:~# cat show.free.disk.space.bash
#!/bin/bash

#This works fine when run manually at the command line
CURRENT=$(df / | grep / | awk '{ print $5}' | sed 's/%//g')

# Body: \Root partition 47 0.000000ull.
printf "To: me@isp.com\nSubject: Free Disk Space\n\n\Root partition $CURRENT% full." | ssmtp me@isp.com

# Empty body :-/
printf "To: me@isp.com\nSubject: Disk Space Alert\nRoot partition $CURRENT% full." | ssmtp me@isp.comAny idea why?

Thank you.latest?d=yIl2AUoC8zA latest?i=6X0jN5Ro7R8:zYswDPPTY5E:F7zBnMy latest?i=6X0jN5Ro7R8:zYswDPPTY5E:V_sGLiP latest?d=qj6IDK7rITs latest?i=6X0jN5Ro7R8:zYswDPPTY5E:gIN9vFw6X0jN5Ro7R8
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments