I am trying to use Linux mail command on red hat linux. It is working fine except when there is hardcoded "\n" characters in the file content i want to send. It is literally taking "\n" as text and message is not getting formatted to give newliine effect.
I am using the following command:
cat ${file-name} | mail -s "Sub" "a.b@c.com"
if the file is regular file with newlines, the output is fine.
But when "\n" is in the text... For Eg:
file contents are like:
ab\ncdefgh\n
add\nadda\n
then it is taking all those \n as characters and printing in the mail as it is. I was expecting it to format as newline as mailx does on solaris.
Please let me know my options.
I already tried:
echo -e
printf