Avoid the ``Three seconds until format begins'' construct. It's
inconsistent with the remaining unix utilities, so replace it by something better suited. Learned from: The Unix Hater's Handbook :-)
This commit is contained in:
parent
8b722cbc8c
commit
ee9ca4bb05
@ -30,7 +30,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" @(#)scsiformat.8 5.1 (Berkeley) 6/5/93
|
||||
.\" $Id$
|
||||
.\" $Id: scsiformat.8,v 1.7 1997/02/22 14:33:17 peter Exp $
|
||||
.\"
|
||||
.Dd June 5, 1993
|
||||
.Dt SCSIFORMAT 8
|
||||
@ -40,7 +40,7 @@
|
||||
.Nd format SCSI disks and show SCSI parameters
|
||||
.Sh SYNOPSIS
|
||||
.Nm scsiformat
|
||||
.Op Fl qw
|
||||
.Op Fl qyw
|
||||
.Op Fl p Ar page-control
|
||||
.Ar device-name
|
||||
.Sh DESCRIPTION
|
||||
@ -81,6 +81,13 @@ shows which parameters are variable.
|
||||
Quiet; suppress the mode page output. Only the inquiry string will be
|
||||
printed, so the operator can ensure he's going to format the intended
|
||||
drive.
|
||||
.It Fl y
|
||||
Yes; do format without asking any question. If this option is not
|
||||
provided,
|
||||
.Nm scsiformat
|
||||
will ask back before actually starting to format the device. At this
|
||||
point, hitting the interrupt key (normally Control-C) will abort the
|
||||
program.
|
||||
.It Fl w
|
||||
Do actually format; by default, only the disk parameters will be
|
||||
displayed.
|
||||
|
@ -26,30 +26,32 @@
|
||||
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# scsiformat [-qw] [-p page-control] raw-device-name
|
||||
# $Id: scsiformat.sh,v 1.4 1997/02/22 14:33:17 peter Exp $
|
||||
#
|
||||
|
||||
PATH="/sbin:/usr/sbin:/bin:/usr/bin"; export PATH
|
||||
|
||||
READONLY=yes
|
||||
DOIT=no
|
||||
QUIET=no
|
||||
RAW=
|
||||
PAGE=0
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "usage: scsiformat [-qw] [-p page-control] raw-device-name" 1>&2
|
||||
echo "usage: scsiformat [-qyw] [-p page-control] raw-device-name" 1>&2
|
||||
exit 2
|
||||
}
|
||||
|
||||
while getopts "qwp:" option
|
||||
while getopts "qwyp:" option
|
||||
do
|
||||
case $option in
|
||||
q)
|
||||
QUIET=yes
|
||||
;;
|
||||
y)
|
||||
DOIT=yes
|
||||
;;
|
||||
w)
|
||||
READONLY=no
|
||||
;;
|
||||
@ -130,14 +132,13 @@ fi # !quiet
|
||||
|
||||
if [ "$READONLY" = "no" ]
|
||||
then
|
||||
# grace period, last chance to hit INTR
|
||||
echo -n "Three seconds until format begins."
|
||||
sleep 1
|
||||
echo -n "."
|
||||
sleep 1
|
||||
echo -n "."
|
||||
sleep 1
|
||||
if [ "$DOIT" != "yes" ]
|
||||
then
|
||||
echo "This will destroy all data on this drive!"
|
||||
echo -n "Hit return to continue, or INTR (^C) to abort: "
|
||||
read dummy
|
||||
fi
|
||||
# formatting may take a huge amount of time, set timeout to 2 hours
|
||||
echo " Formatting... this may take a while."
|
||||
echo "Formatting... this may take a while."
|
||||
scsi -s 7200 -f $RAW -c "4 0 0 0 0 0"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user