On Tue, 18 Nov 2003, Bernard Doyle wrote:
> On Tue, 18 Nov 2003, Lyle Chapman wrote:
>
> > I have a small script that monitors a particular folder and then
> > forwards files for printing, can anybody show me how to suppress error
> > messages and only display certain messages like "Looking for files to
> > print" and "Files found! Preparing to print" or something along those
> > lines and make it loop forever?
Just to complete the Script:-
#!/bin/sh
running=1;
while [ $running -eq 1 ]; do
ls/home/user/workflow/Proofers/A4/*.pdf 2>/dev/null
if [ $? -eq 0 ] ; then
echo "A4 Files Found!!"
lp -d brothers /home/user/workflow/Proofers/A4/*.pdf 2>/dev/null
if [ $? -eq 0 ] ; then
# Possibly put in a sleep(60) or whatever here so
# files are not deleted b4 printing
echo "A4 Files Printed!!"
rm /home/user/workflow/Proofers/A4/*.pdf 2>/dev/null
fi
fi
ls/home/user/workflow/Proofers/A3/*.pdf 2>/dev/null
if [ $? -eq 0 ] ; then
echo "A3 Files Found!!"
lp -d brothers /home/user/workflow/Proofers/A3/*.pdf 2>/dev/null
if [ $? -eq 0 ] ; then
# Possibly put in a sleep(60) or whatever here so
# files are not deleted b4 printing
echo "A3 Files Printed!!"
rm /home/user/workflow/Proofers/A3/*.pdf 2>/dev/null
fi
fi
done
cheers,
Bernard Doyle
> >
> > #!/bin/sh
> > #Looping .pdf script
> >
> > do
> > echo looking for file to print
> > lp -d brothers /home/user/workflow/Proofers/A4/*.pdf
> > lp -d xeroxq /home/user/workflow/Proofers/A3/*.pdf
> > rm /home/user/workflow/Proofers/A4/*.pdf
> > rm /home/user/workflow/Proofers/A3/*.pdf
> > sleep 15
> > done
> >
> > If anyone could help out I would appreciate it, my programming and
> > scripting skills are basically zero.
> >
> >
> >
> > Lyle Chapman
> >
> > Pre-Press Supervisor
> > Torch Publishing Co.
> > 47 Allingham Street, Condell Park 2200, NSW, Australia
> > 612 9795 0000
> > http://www.torchpublishing.com.au
> > --
> > SLUG - Sydney Linux User's Group - http://slug.org.au/
> > More Info: http://lists.slug.org.au/listinfo/slug
> >
>
>
> --
> SLUG - Sydney Linux User's Group - http://slug.org.au/
> More Info: http://lists.slug.org.au/listinfo/slug
>
--
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug