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:
Joerg Wunsch 1997-03-02 11:21:07 +00:00
parent a896f0256c
commit 06996f8920
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=23255
2 changed files with 23 additions and 15 deletions

View File

@ -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.

View File

@ -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