#not needed in tcsh: #!/bin/csh -f ### aps: ascii to .ps a file with fontsize ### usage: aps file fontsize [b] ## OR files side-by-side: ### usage: aps f1 f2 fontsize file12 ## a2ps -c -nH -F(font) f1 f2 > file12.ps #:::: a2ps -h; good for greek too ! echo "" if( -x /usr/local/bin/a2ps ) then set A2PS = /usr/local/bin/a2ps else echo " ===> /usr/local/bin/a2ps does not exist ! ... exiting ..." exit endif if( "$4" == "" ) then ##...... only one file, 3 arguments ... set file = $1 set fnt = $2 set bord = $3 if( "$1" == "" ) then echo ' Usage: aps file font : -> file.ps - no border' echo ' or : aps file font b : -> file.ps - with border' echo ' or : aps f1 f2 font out: -> side-by-side f1 f2 > out.ps' echo " " echo -n ' ----> Enter file name (blank to exit) : ' set file = $< endif if( "$file" == "" ) then exit endif if( "$2" == "" ) then echo -n ' --> file=' $file ' -- Enter font size: ' set fnt = $< endif if( "$3" == "" ) then echo " ---> creating $file".ps" , no border [b] <---" ${A2PS} -ns -p -nH -d -F"$fnt" $file > "$file".ps else if ( "$3" == "b" ) then echo " ---> creating $file".ps" , with border <---" ${A2PS} -s -p -nH -d -F"$fnt" $file > "$file".ps endif echo -n " ---> If you do NOT want to view it on gv, Enter n: " set no = $< if( "$no" != "n" ) then gv "$file".ps endif exit else ## if ( "$4" != "" ) then ##....... 2 files side-by-side .... set f1 = $1 set f2 = $2 set fnt = $3 set out = $4 echo " --> creating side-by-side f1 f2 > $out".ps" " ${A2PS} -c -nH -F"$fnt" $f1 $f2 > "$out".ps echo -n " ---> If you do NOT want to view it on gv, Enter n: " set no = $< if( "$no" != "n" ) then gv "$out".ps endif exit endif