From owner-freebsd-questions@FreeBSD.ORG Tue Sep 14 00:57:35 2004 Return-Path: Delivered-To: freebsd-questions@www.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3C8E016A4CE for ; Tue, 14 Sep 2004 00:57:35 +0000 (GMT) Received: from o2.hostbaby.com (o2.hostbaby.com [208.187.29.121]) by mx1.FreeBSD.org (Postfix) with SMTP id E998843D54 for ; Tue, 14 Sep 2004 00:57:34 +0000 (GMT) (envelope-from ceo@l-i-e.com) Received: (qmail 52618 invoked by uid 1001); 14 Sep 2004 00:57:38 -0000 Received: from 67.167.52.21 (SquirrelMail authenticated user ceo@l-i-e.com); by www.l-i-e.com with HTTP; Mon, 13 Sep 2004 17:57:38 -0700 (PDT) Message-ID: <4371.67.167.52.21.1095123458.squirrel@www.l-i-e.com> In-Reply-To: <50164.208.4.77.15.1095096715.squirrel@www2.neuroflux.com> References: <50164.208.4.77.15.1095096715.squirrel@www2.neuroflux.com> Date: Mon, 13 Sep 2004 17:57:38 -0700 (PDT) From: "Richard Lynch" To: "Ryan Sommers" User-Agent: Hostbaby Webmail X-Mailer: Hostbaby Webmail MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal cc: freebsd-questions@lists.freebsd.org Subject: Re: Mail from a shell script? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: ceo@l-i-e.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2004 00:57:35 -0000 Ryan Sommers wrote: > First problem I ran into. I'm attempting to send the mail via `which > mail`. I first was going to attempt to concatenate the message via > "message=${message}$'\n'" However, this strips the newlines > out of the variable (both sh and bash). I then tried using the < redirection in bash/sh and same thing happened. Things I would try: Use \\n so that the first pass "eats up" \\ to product \ and then you have \n where you want it. Paste in a literal new-line (control-v/control-m in vi) so that you don't have to rely on \n to work. Also, in "man 5 crontab" there is reference to using %% or somesuch for newlines in mail. I'm not sure if that's a cron thing or a mail thing, but it may be useful. Dislaimer: All of this comes from Linux/PHP experience, and not so much FreeBSD. YMMV. -- Like Music? http://l-i-e.com/artists.htm