LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Bash scripting new line interpretation (https://www.linuxquestions.org/questions/programming-9/bash-scripting-new-line-interpretation-565118/)

lord-fu 06-28-2007 10:15 AM

Bash scripting new line interpretation
 
Hello and mtia.
basically I am calling a system command from an asterisk dialplan.

Code:

System(/bin/echo -e "From: ${CALLERID(all)} \n To: Test" | /usr/bin/mutt -a /var/spool/asterisk/fax/1182976018.452.tif -s "FAX - From ${CALLERID(all)}" "${FAXTOEMAILADDRESS}")
I also tried like this.
Code:

System(/bin/echo -e "From: ${CALLERID(all)}" \n "To: Test" | /usr/bin/mutt -a /var/spool/asterisk/fax/1182976018.452.tif -s "FAX - From ${CALLERID(all)}" "${FAXTOEMAILADDRESS}")
I always receive this in the body:
From: <phone numbers> n To: Test
Never a new line. Any ideas?

mtia

unSpawn 06-28-2007 01:07 PM

Escape the backslash like \\\? What shows if you output to tmpfile for testing purposes? Else is this really a Bash problem?

lord-fu 06-28-2007 01:26 PM

Newlines do appear fine in testing, I had made sure to test that before I posted. They do not in the above example, however that is now a moot point as a one line body is fine in the sending of the mail.


Thanks for the response anyways unSpawn.

unSpawn 06-28-2007 04:10 PM

Ok, Np.....

bartonski 06-29-2007 04:34 PM

Quote:

Originally Posted by unSpawn
Ok, Np.....

I guess that problem was NP-Easy ;)


All times are GMT -5. The time now is 06:08 AM.