#
#####Message Texts######
set mesg1a = "Please specify the type of dump to be performed;"
set mesg1b = "daily, weekly, monthly:"
set mesg2 = "Not a valid response, please specify daily, weekly, or monthly:"
set mesg3 = "These are the file systems currently mounted on"
set mesg4 = "Please specify which filesystem to dump:"
set mesg5 = "Please mount necessary tape and strike <RET> when ready."
########################
cp how_to_dump how_to_dump.sav	# prepare to restore
				# get level (type) of dump 
echo $mesg1a $mesg1b' '
get_type:
set type = ($<)
if ($#type == 0) then
	goto get_type
endif
				# translate type of dump inte level num.
switch ($type)
	case d:
	case day:
	case daily:
		set level = 2
		breaksw
	case w:
	case week:
	case weekly:
		set level = 1
		breaksw
	case m:
	case month:
	case monthly:
		set level = 0
		breaksw
	default:
          echo $mesg2' '
	  goto get_type
	  breaksw
endsw
					# write level onto dump comm. template
sed s%LLL%$level% how_to_dump > temp
mv temp how_to_dump
					# show which filesystems are mounted
echo $mesg3' '`hostname`
echo ''
df
echo ''
echo $mesg4' '
get_fsy:
set fsy = ($<)
if ($#fsy == 0) then
	goto get_fsy
endif
			    # write file system spec. onto dump comm. template
sed s%XXX%$fsy% how_to_dump > temp
mv temp how_to_dump
chmod 700 how_to_dump
				# tell user to mount tape before we execute
echo $mesg5
set ready = ($<)
how_to_dump
mv how_to_dump.sav how_to_dump		# restore how_to_dump
