Hey all,
I'm kind of a newbee to UNIX and need to write a script that checks our "backups", which are just gzip'd tars and sybase dumps. I need to write a script that will use "gzip -t" to test the validity of the compression for a 20-30 files. I cannot for the life of me redirect "gzip -t <filename>.gz" to a file. I want to do this, so I can then search the output for lines that are NOT:
FILENAME.gz: OK
but I can't redirect the output. The only way that I could do it was to use an expect script, which was built through the autoexpect command/script to redirect the output, which I would use to check if the "backups" were OK.
I have 2 1/2 questions:
1) Are there commands that you canNOT redirect?
1 1/2) How would you redirect "gzip -t"
2) If you can't redirect "gzip -t" with a typical shell script, what language would you use?