That looks great, one quick question. The source files will either be .ps or .prn, which ghostscript copes with equally well, so the ls command I am using is:
Code:
ls $dir/in/{*.ps,*.prn}|while....
However if the "in" directory is empty, or there are no .ps files (and are .prn files) I get an on-screen error such as:
Code:
ls: .../in/*.ps: No such file or directory
As I want this script to be run on a cron, I obviously don't want to have messages filling up the log. As this error is obviously useless (as I don't need to know the folders empty) would a redirect to /dev/null be OK? e.g.
Code:
ls $dir/in/{*.ps,*.prn} 2>/dev/null|while....
or do I need to redirect the results to the while loop?
Also, can I get the basename command to cope with the 2 different extensions?
Dan