where are you trying? on a PC after having copied the file in Widows?
because if your txt file has 3 line cat will display 3 lines... ( in other words it looks like a DOS conversion with Line feed you are after...
Here on a debian:
Don't mix up "carriage return" with "\n" (which is "line feed"). When expanding an unquoted variable (with the default IFS variable), ALL whitespace will be replaced by the first IFS character, usually a space. That's why the "\n" is "lost"...
BLABLA
blablabla
etc...
(I need of line feed)
BLABLA
blablabla
(I need of line feed)
blablabla\
etc...
My script into another file :
#!/bin/bash
sender="me@example.com"
recipient="you@example.com"
subject="TEST FILE"
server="0.0.0.0"
file=$(I want to read my file with cat or another...with the line feed)
/usr/bin/sendemail -f $sender -t $recipient -u $subject -m $file
wall:
---------- Post updated at 12:37 PM ---------- Previous update was at 12:36 PM ----------
Thank you very much ! That works :) And sorry I didn't understand the quotes...I'm ashamed :o