1826443 Members
3931 Online
109692 Solutions
New Discussion

Re: gzip question

 
SOLVED
Go to solution
Hunki
Super Advisor

gzip question

Problem Decription :
In my script I am using the following command :

gzip /qsm/ear/backup/EAR.ear.*

Let's say if the file does not exist and I get an error output when the script is running : "No such file or directory".

Question : How do I avoid this error output within the script ... redirecting it to /dev/null did not work.

2 REPLIES 2
James R. Ferguson
Acclaimed Contributor
Solution

Re: gzip question

Hi Hunki:

You need to redirect STDERR:

# gzip /qsm/ear/backup/EAR.ear.* 2>/dev/null

Well-bahaved Unix coding puts error and warning output to STDERR (file descriptor-2).

Regards!

...JRF...
Hunki
Super Advisor

Re: gzip question

Thanks JRF!