From owner-freebsd-questions Thu Nov 21 21:30:31 2002 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 4DE5537B401 for ; Thu, 21 Nov 2002 21:30:30 -0800 (PST) Received: from smtp02.mrf.mail.rcn.net (smtp02.mrf.mail.rcn.net [207.172.4.61]) by mx1.FreeBSD.org (Postfix) with ESMTP id AC0F743E4A for ; Thu, 21 Nov 2002 21:30:29 -0800 (PST) (envelope-from rjhalljr@starpower.net) Received: from [208.58.197.178] (helo=sten.alder.net) by smtp02.mrf.mail.rcn.net with smtp (Exim 3.35 #4) id 18F6Oa-00001W-00 for freebsd-questions@freebsd.org; Fri, 22 Nov 2002 00:30:28 -0500 Received: by sten.alder.net (sSMTP sendmail emulation); Fri, 22 Nov 2002 00:29:59 -0500 Date: Fri, 22 Nov 2002 00:29:59 -0500 From: "Bob Hall" To: FreeBSD Questions List Subject: Re: Bash programming; Was: connecting to SCSI drive Message-ID: <20021122052959.GA611@sten.alder.net> Mail-Followup-To: Bob Hall , FreeBSD Questions List References: <20021120180314.GA564@sten.alder.net> <20021120182423.GB30909@dan.emsphone.com> <3DDBE4A9.5060708@mac.com> <20021120204738.GA949@sten.alder.net> <20021121071713.GA2641@sten.alder.net> <20021121094112.GR77198@freepuppy.bellavista.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021121094112.GR77198@freepuppy.bellavista.cz> User-Agent: Mutt/1.4i Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Nov 21, 2002 at 10:41:13AM +0100, Roman Neuhauser wrote: > MSG=$(sudo mount ... 2>&1) > if [ $? -ne 0 -a $MSG == "Device not configured" ]; then > echo "My custom error message" > fi Thanks. The one thing I never thought to try was putting '2>&1' *inside* the parentheses. It makes sense, now that I know about it. Bob Hall To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message