Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Nov 2002 02:17:13 -0500
From:      "Bob Hall" <rjhalljr@starpower.net>
To:        FreeBSD Questions List <freebsd-questions@freebsd.org>
Subject:   Bash programming; Was: connecting to SCSI drive
Message-ID:  <20021121071713.GA2641@sten.alder.net>
In-Reply-To: <20021120204738.GA949@sten.alder.net>
References:  <20021120180314.GA564@sten.alder.net> <20021120182423.GB30909@dan.emsphone.com> <3DDBE4A9.5060708@mac.com> <20021120204738.GA949@sten.alder.net>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021121071713.GA2641>