## Date: Mon, 27 Sep 2004 09:26:38 -0400 (EDT) ## From: Fabrizio Morbini ## To: "Lenhart K. Schubert" ## Subject: script for automatic printing of the slides ## ## ## Hi Len, attached there is a script that automatically prints the desired ## 447 slides. (the input parameter is the lecture number: 01 ... 06). I ## don't know if it could be useful to other students. ## ## It doesn't reduce the resolution so the printing takes some (a lot of) ## time. ## ## The default printer is dali, simply edit the script and change the ## PRINTER variable to select your preferred printer. ## ## Fabrizio. ## Content-Description: #!/bin/bash #choose the printer PRINTER=dali #color #PRINTER=chaucer #black and white 7th floor #PRINTER=shake #black and white 6th floor if [ -z $1 ] then echo "These are the slides available:"; ls /u/www/u/schubert/247-447/slides/; echo "give one of the listed numbers as parameter of the script" elif ( ls /u/www/u/schubert/247-447/slides/$1 &> /dev/null ) then echo "The slide exists! printing in progress..." for f in $(ls /u/www/u/schubert/247-447/slides/$1/*.jpg); do echo $f NAME=$(basename $f) echo "Conversion of $NAME in progress..." convert -page A4+0+0 $f ~/tmp/$NAME.ps echo "Printing of $NAME.ps on $PRINTER in progress..." lpr -P$PRINTER ~/tmp/$NAME.ps echo "~/tmp/$NAME.ps removed." rm -f ~/tmp/$NAME.ps done else echo "The slide you specified DOESN'T exist!" echo "These are the slides available:"; ls /u/www/u/schubert/247-447/slides/; echo "give one of the listed numbers as parameter of the script" fi