[112] in RedHat Linux List
Re: bug in /etc/rc.d/rc.sysinit?
daemon@ATHENA.MIT.EDU (Piete Brooks)
Mon Oct 21 18:21:31 1996
To: redhat-list@redhat.com
cc: maillard@vt.edu
In-reply-to: Your message of Mon, 21 Oct 1996 15:09:24 -0400.
<199610211909.PAA10882@tristan.redhat.com>
Date: Mon, 21 Oct 1996 22:10:29 +0100
From: Piete Brooks <Piete.Brooks@cl.cam.ac.uk>
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
[[ I sent in a very similar RFE and fix ... ]]
>> can i just add if [ -f /proc/scsi/scsi ]; then ... arround the above if?
> Yes, but actually, I'd suggest something like this:
> if cat /proc/scsi/scsi | grep 'Type: Sequential-Access' >/dev/null 2>&1 ; then
> if cat /proc/devices | grep -qv ' 9 st' ; then
> insmod st
> fi
> fi
> That avoids an extra command invocation.
... but what is the point ? grep won't write anything to stderr (will it ?).
If /proc/scsi/scsi does not exist, cat will still generate an error message
to stderr, which is not redirected.
Now, if you removed a spurious process, it would be better,
if grep 'Type: Sequential-Access' /proc/scsi/scsi >/dev/null 2>&1
or even get grep to fo the business for you,
if grep -qs 'Type: Sequential-Access' /proc/scsi/scsi
--
PLEASE read the Red Hat FAQ, Tips, HOWTO and the MAILING LIST ARCHIVES!
________________________________________________________________________
http://www.redhat.com/RedHat-FAQ http://www.redhat.com/RedHat-HOWTO
http://www.redhat.com/RedHat-Tips http://www.redhat.com/mailing-lists
------------------------------------------------------------------------
To unsubscribe: mail -s unsubscribe redhat-list-request@redhat.com < /dev/null