From owner-freebsd-questions@FreeBSD.ORG Mon Sep 13 17:25:36 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 22C3916A4CE for ; Mon, 13 Sep 2004 17:25:36 +0000 (GMT) Received: from mailserv1.neuroflux.com (mailserv1.neuroflux.com [204.228.228.92]) by mx1.FreeBSD.org (Postfix) with ESMTP id BB9F943D2D for ; Mon, 13 Sep 2004 17:25:35 +0000 (GMT) (envelope-from ryans@gamersimpact.com) Received: (qmail 67598 invoked by uid 89); 13 Sep 2004 17:31:55 -0000 Received: from unknown (HELO www2.neuroflux.com) (127.0.0.1) by localhost with SMTP; 13 Sep 2004 17:31:55 -0000 Received: from 208.4.77.15 (SquirrelMail authenticated user ryans@gamersimpact.com) by www2.neuroflux.com with HTTP; Mon, 13 Sep 2004 11:31:55 -0600 (MDT) Message-ID: <50164.208.4.77.15.1095096715.squirrel@www2.neuroflux.com> Date: Mon, 13 Sep 2004 11:31:55 -0600 (MDT) From: "Ryan Sommers" To: freebsd-questions@freebsd.org User-Agent: SquirrelMail/1.4.2 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 Importance: Normal Subject: Mail from a shell script? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Sep 2004 17:25:36 -0000 I'm attempting to have a few shell scripts email output. I'm running into a few problems and was wondering if there were any ways to overcome them in a shell script or whether I'll have to go to perl or not. (Note, shell doesn't matter, I've been using sh but recently went to bash since sh on solaris (one of the machines the scripts get used on) doesn't support the -e expression for test(1)). 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 <". Ryan ryans@gamersimpact.com