From owner-freebsd-questions Wed Nov 20 23:17:54 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 7A36D37B401 for ; Wed, 20 Nov 2002 23:17:53 -0800 (PST) Received: from smtp01.mrf.mail.rcn.net (smtp01.mrf.mail.rcn.net [207.172.4.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id A82C343E88 for ; Wed, 20 Nov 2002 23:17:45 -0800 (PST) (envelope-from rjhalljr@starpower.net) Received: from 66-44-55-36.s290.tnt1.lnhva.md.dialup.rcn.com ([66.44.55.36] helo=sten.alder.net) by smtp01.mrf.mail.rcn.net with smtp (Exim 3.35 #4) id 18Elaq-00050n-00 for freebsd-questions@freebsd.org; Thu, 21 Nov 2002 02:17:44 -0500 Received: by sten.alder.net (sSMTP sendmail emulation); Thu, 21 Nov 2002 02:17:13 -0500 Date: Thu, 21 Nov 2002 02:17:13 -0500 From: "Bob Hall" To: FreeBSD Questions List Subject: Bash programming; Was: connecting to SCSI drive Message-ID: <20021121071713.GA2641@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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021120204738.GA949@sten.alder.net> 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 Following the suggestions that were posted, I now have a working script that checks for a connection to the DVD-RAM drive. The following works, but returns the 'Device not configured' error if there's no disk in the drive. elif !(sudo mount -t ufs -o rw /dev/cd0a $montering_punkt) then Currently, I'm suppressing the error message (2>/dev/null), but I'd rather capture sterr in a variable and replace it with a custom message if the error is 'Device not configured'. (The devise is configured, but I forgot to put a disk in the drive, so the system error message is confusing.) I've tried read and redirection, but I can't seem to capture the error message in a variable. Does anyone know how to do this? Bob Hall To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message