Format and verify for SCO 2.2.1

Brian Fitzgerald brianf at sixbdf
Fri Aug 25 07:14:34 AEST 1989


This formats floppys until the intr character is pressed.
It includes a little script to find out what the interrupt character is
so it can be used in a prompt.

#!/bin/sh
# shar:	Shell Archiver  (v1.24)
#
#	Run the following text with /bin/sh to create:
#	  mformat
#
echo "x - extracting mformat (Text)"
sed 's/^X//' << 'SHAR_EOF' > mformat &&
X# mformat sixbdf!brian 08/23/89
X# for SCO Xenix 2.2.1 that doesn't automatically do a verify
X# check media
Xcase $1 in
X	a*) # un-comment line for whatever you want to be the default format 
X		# disk=/dev/rfd048ds9	# 360K 5.25"
X		disk=/dev/rfd096ds9	# 720K 5.25"
X		# disk=/dev/rfd096ds15	# 1.2 meg 5.25"
X		# disk=/dev/rfd096ds18	# 1.44 meg 3.5"
X	;;
X	b*) # un-comment line for whatever you want to be the default format 
X		disk=/dev/rfd148ds9	# 360K 5.25"
X		# disk=/dev/rfd196ds9	# 720K 5.25"
X		# disk=/dev/rfd196ds15	# 1.2 meg 5.25"
X		# disk=/dev/rfd196ds18	# 1.44 meg 3.5"
X	;;
X	/dev/rfd*) disk=$1
X	;;
X	*)  echo No way!
X	    exit 0
X	;;
Xesac
X
X# find out what intr is set to
Xsttyrpt=`stty -a`
Xset $sttyrpt
Xwhile test "$1" != "intr"
X	do shift
Xdone
Xshift;shift
Xintrchar=`echo $1 | tr -d \;`
X
X# format & verify those disks
X
Xwhile true
Xdo
X	format $disk
X	echo verifying $disk
X	dd if=$disk of=/dev/null bs=18k
X	case $? in
X	0)	echo done
X		;;
X	*)	clear
X		echo Error encountered while verifying $disk!
X		echo Do not use this diskette!
X		;;
Xesac
Xecho
Xecho -n "Press $intrchar to abort, otherwise, "
Xdone
SHAR_EOF
chmod 0755 mformat || echo "restore of mformat fails"
exit 0



More information about the Alt.sources mailing list