On Tuesday 18 November 2003 15:49, 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?

If you want to suppress error messages for the whole script, run it like this:

./script.sh 2> /dev/null

This redirects all output on stderr to /dev/null

Similarly if you want to supress errors on a particular line eg:

lp -d xeroxq /home/user/workflow/Proofers/A3/*.pdf 2>/dev/null 

If you want to suppress ALL output an easy way is to end the line with eg: 

lp -d xeroxq /home/user/workflow/Proofers/A3/*.pdf >/dev/null 2>&1

This sends all normal output to /dev/null, and also sends all errors to normal 
output.

> #!/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

-- 
Matthew Wlazlo

Dimension Technology         Phone   :  (+61 2) 8230 0321
[EMAIL PROTECTED]          Mobile  : (+61) 0411 325 520
www.dimtech.com.au

PGP Key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xA30E22E9
--------------------------------------------------------
CAUTION:
This message may contain privileged and confidential information
intended only for the use of the addressee named above. If you are not
the intended recipient of this message you are hereby notified that
any use, dissemination, distribution or reproduction of this message
is prohibited. If you have received this message in error please
notify Dimension Technology immediately.
--------------------------------------------------------


Attachment: pgp00000.pgp
Description: signature

Attachment: pgp00001.pgp
Description: signature

-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to