#! /bin/csh ########################################################################## # convertpict2gif # # Convert PICT files to GIF files # # Read source filenames from a given file and does the conversion # for each file. This script uses the routines, picttoppm and ppmtogif, # from the pbmplus toolkit. # # This script is part of the Mac to PC CD-ROM port. The purpose of this # script is to convert *.PICT files to GIF files # which is something the PC can understand. # # Input file format is: # # # # # ... # # Algorithm: # # For each filename # Convert the file from PICT to GIF format # # AW 9607.02 ########################################################################## echo "*************************" echo "Convert PICT-->GIF Format" echo "*************************" switch ( $#argv ) case 1: set InpFile = $1 echo "" echo "Input File is $InpFile" breaksw default: echo "Usage:" echo "" echo " convertpict2gif " echo "" exit breaksw endsw ############################### # Process each source filename ############################### set FileNames = `cat $InpFile` while ( $#FileNames ) # For each filename ###################################### # Get basename file minus (.pic, .PIC, .pict, .PICT) suffix ###################################### set Name = `basename $FileNames[1]` # Grab filename.ext set Source = $FileNames[1] set Target = `basename $Name _final` #################### # Get directory path #################### set Directory = `dirname $Source` echo "" echo "Directory is $Directory" echo "Source is $Source" echo "Target is $Directory/$Target.gif" ############################### # Do the PICT-->GIF conversion! ############################### picttoppm $Source | ppmtogif > $Directory/$Target.gif shift FileNames # Get next file end echo "" echo "*******************************" echo "End - Convert PICT-->GIF Format" echo "*******************************"