Tugger the SLUGger!SLUG Mailing List Archives

[SLUG] pdf sweeper


Hey people,
I'm after a cool way of generating PDF's from a windows box with a Linux
server.
I have found a few ways, so far the most attractive to me seems to be this
pdf sweeper.
http://www.linux.ie/pipermail/ilug/2000-June/018505.html

The author of this script has seemed to done a good job, tho the mailing
list software has wrapped his work.
This is the script:
(includes the wrapping)

#!/bin/bash

# Postscript to PDF sweeper
# Author: Conor Daly <conor.daly@xxxxxxxxxxxxx>
# Date: 8th June 2000
# Converts any *.ps found in the specified directory to *.pdf and deletes
the *.ps
#
# Licensing:  Use as per GPL
#

case in $#argv do    #not quite sure of the syntax for "case in"  "$#argv"
should give the number of arguments passed
case 3);                    # to the script including "$0" as the name of
the script.
    cd $2

    do                        # not quite sure of the infinite loop thing
but "do... done" should do it.
        for incoming in `ls *.ps` do
            outgoing=`basename $incoming ps`pdf
            ps2pdf $incoming $outgoing
            rm -f $incoming
        done
        sleep $1
    done
    ;;
case *)
    echo Useage: $0 <Delay in seconds> <Full path to Directory>
    exit 0
    ;;
done
exit 0
# end of Postscript to PDF Sweeper

The first 3 lins of the script give me problems, I'm not sure of the case
syntax. I tried a fair few combinations but can't seem to get case figured
out.
If anyone can assist that would be great. Or even suggest a better method...
I understand ps2pdf but can't seem to get it working with printcap. Not sure
what entry to use there.

Thanks,

Dave

______________________________
solutionsFirst.net Consulting
http://solutionsfirst.net
Ph: (02) 9413 9604
Fax: (02) 9413 9719
Mob: 0413 022 143