1 #!/bin/sh 2 3 # Common routines. 4 5 # Test for a selected device. 6 7 check_device() 8 { 9 if [ ! "$DEV" ] ; then 10 cat 1>&2 <<EOF 11 No device specified. Use the DEV environment variable to indicate a device. 12 EOF 13 exit 1 14 fi 15 16 if [ ! -e "$DEV" ] ; then 17 cat 1>&2 <<EOF 18 Device not found: $DEV 19 EOF 20 exit 1 21 fi 22 } 23 24 # Process partition field values in summary tables. 25 26 read_fields() 27 { 28 OLDIFS=$IFS 29 IFS=`echo -n '\t'` read START SIZE TYPE 30 STATUS=$? 31 IFS=$OLDIFS 32 return $STATUS 33 }