Re: [osol-discuss] Q: Adding newlines to script email output

2010-05-24 Thread Johan Eliasson
talonso's suggestion about quotes around the $message worked nicely and required the least modification, so I went with that. Thank you all for your replies! -- This message posted from opensolaris.org ___ opensolaris-discuss mailing list

[osol-discuss] Q: Adding newlines to script email output

2010-05-03 Thread Johan Eliasson
Greetings! I have a little script that looks like below, that emails me info on my zfs pool every day: --- start script --- message=`/usr/sbin/zfs list -r tank` echo Subject: filez ZFS Information\n\n$message | mail fi...@nebol.se --- end script --- My problem is that when I view the mail in

Re: [osol-discuss] Q: Adding newlines to script email output

2010-05-03 Thread Milan Cermak
Hi Johan, storing the command output in the variable removes the newlines (or better to say, it replaces them with spaces). To get formatted message, you may do something like: ( echo Subject: filez ZFS Information\n\n; /usr/sbin/zfs list -r tank ) | mail address Regards, Milan Cermak

Re: [osol-discuss] Q: Adding newlines to script email output

2010-05-03 Thread Tirso Alonso
Needs quotes around $message message=`/usr/sbin/zfs list -r tank` echo Subject: filez ZFS Information\n\n$message | mail filez at nebol dot se should work. -- This message posted from opensolaris.org ___ opensolaris-discuss mailing list

Re: [osol-discuss] Q: Adding newlines to script email output

2010-05-03 Thread Oscar del Rio
On 5/3/2010 5:13 AM, Johan Eliasson wrote: message=`/usr/sbin/zfs list -r tank` echo Subject: filez ZFS Information\n\n$message | mail fi...@nebol.se Impossible to read.. how can I add newlines to the email? I imagine/hope it's a simple thing for you script-people... :) /usr/sbin/zfs

Re: [osol-discuss] Q: Adding newlines to script email output

2010-05-03 Thread Ron Halstead
Try this: message=`/usr/sbin/zfs list -r tank` echo Subject: filez ZFS Information\n\n${message}| mail filez at nebol dot se That is curly braces around $message in the echo statement. ---ron -- This message posted from opensolaris.org ___

Re: [osol-discuss] Q: Adding newlines to script email output

2010-05-03 Thread ольга крыжановская
Try: = cut = message=$( /usr/sbin/zfs list -r tank ) { # header printf Subject: filez ZFS Information\n\n # message body cat ${message} } | mail fi...@nebol.se = cut = Olga On Mon, May 3, 2010 at 8:40 PM, Ron Halstead rdhalst...@gmail.com wrote: Try this: