Unanswered: SendMail embedding linefeeds in the message body
OK, first, I haven't even begun unix 101 or shell scripts so go easy with me. This is what we're using and it works, I'd just like to dress up the body by inserting newline/return/LFCR, tabs, etc .... Is it possible?
java SendMail -g est04grp -f pcunix -s "EST04 Notification" -m "Attached please find two reports: est04.fc.new which contains a list of original Final Certificates printed and est04.fc.rep which contains a list of reprinted Final Certificates. Please contact Jeff Miller, if there are any questions or concerns. Thank you." -a "$NEW_FC_REPORT" -a "$REPRINTED_FC_REPORT"
It didn't work, the email is recieved with the slashes and characters printed with the text. I've tried separating the message with quotes and putting the control characters between the lines and it still prints the control characters within the body. HELP !
good old meta characters. instead of double quotes " use single quotes '
if that doesn't work you may need to escape your backslashes \ with a backslash \ themselves.
Check this. To ftp into an NT ftp server from a unix one, I had to do the following:
user domain\\\\name password
a the 4 backslashes send 2 backslashes to the script, which sends 1 backslash to the ftp program. I think you're running into the same thing. Your stuffs is being interpretted in the double quotes. single quotes will kill the issue if you're using a unix shell. escaping the backslash \ escape character with an escape character, namely a backslash, will send a literal backslash through. Of course, you may have to do what I did and escape the escape of the escape. Hehehe. any wonder why regular expressions look so funny?
oops. I misread the thread. Please ignore my above lame comments. In atonement, I offer the following
$ var="foo\nbar"; export var
$ echo $var
$ var2=`echo $var`; export var2
$ echo $var2
$ cat << !!
Go figure, huh? Cat isn't interpretting the newlines into their ascii equivalents, but if you feed the already interpretted newlines into it, it works, but breaks the original. I'll leave it up to ya'll.