Gzip status output is not redirecting.


 
Thread Tools Search this Thread
Operating Systems AIX Gzip status output is not redirecting.
# 1  
Old 09-09-2013
Facebook [Solved] Gzip status output is not redirecting.

Dear all

I am facing issue in one part of my script.
in this part i am trying to zip the files but want the status to be redirected to a text file

Code:
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas> cat final_col.sh
gzip -cv /data01/oracle/oradata/vas/control/control01.ctl >  /dbbackup/oracle/VAS/data/control01.ctl.gz
gzip -cv /data01/oracle/oradata/vas/control/control02.ctl >  /dbbackup/oracle/VAS/data/control02.ctl.gz
gzip -cv /data01/oracle/oradata/vas/control/control03.ctl >  /dbbackup/oracle/VAS/data/control03.ctl.gz
gzip -cv /oracle/app/oracle/11.2.0.3/dbs/initvas.ora >  /dbbackup/oracle/VAS/data/initvas.ora.gz
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas> sh final_col.sh
/data01/oracle/oradata/vas/control/control01.ctl:        99.7%
/data01/oracle/oradata/vas/control/control02.ctl:        99.7%
/data01/oracle/oradata/vas/control/control03.ctl:        99.7%
/oracle/app/oracle/11.2.0.3/dbs/initvas.ora:     52.9%
YAMVASSRV02[oracle]_vas>


I tried redirecting it but not worked.

Code:
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas> sh final_col.sh >final_col.txt
/data01/oracle/oradata/vas/control/control01.ctl:        99.7%
/data01/oracle/oradata/vas/control/control02.ctl:        99.7%
/data01/oracle/oradata/vas/control/control03.ctl:        99.7%
/oracle/app/oracle/11.2.0.3/dbs/initvas.ora:     52.9%
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas> cat final_col.txt
YAMVASSRV02[oracle]_vas>

Code:
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas> sh final_col.sh 2>&1 >final_col.txt
/data01/oracle/oradata/vas/control/control01.ctl:        99.7%
/data01/oracle/oradata/vas/control/control02.ctl:        99.7%
/data01/oracle/oradata/vas/control/control03.ctl:        99.7%
/oracle/app/oracle/11.2.0.3/dbs/initvas.ora:     52.9%
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas> cat final_col.txt
YAMVASSRV02[oracle]_vas>

Code:
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas> cat final_col.txt
YAMVASSRV02[oracle]_vas> sh final_col.sh |tee -a final_col.txt
/data01/oracle/oradata/vas/control/control01.ctl:        99.7%
/data01/oracle/oradata/vas/control/control02.ctl:        99.7%
/data01/oracle/oradata/vas/control/control03.ctl:        99.7%
/oracle/app/oracle/11.2.0.3/dbs/initvas.ora:     52.9%
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas> cat
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas> cat final_col.txt
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas> sh final_col.sh |tee -a >final_col.txt
/data01/oracle/oradata/vas/control/control01.ctl:        99.7%
/data01/oracle/oradata/vas/control/control02.ctl:        99.7%
/data01/oracle/oradata/vas/control/control03.ctl:        99.7%
/oracle/app/oracle/11.2.0.3/dbs/initvas.ora:     52.9%
YAMVASSRV02[oracle]_vas>
YAMVASSRV02[oracle]_vas>


Any body have any idea about how to do it.
# 2  
Old 09-09-2013
You need to redirect stderr:
Code:
2>final_col.txt

or
Code:
>final_col.txt 2>&1

or
Code:
&>final_col.txt

None of these is found in your examples.
# 3  
Old 09-09-2013
Hi RudiC


Perfect option 1, 2 both worked but with 3rd option the result is not getting
any ways i need to use any one

Thanks
Kaleem.

Moderator's Comments:
Mod Comment edit by bakunin: changed thread title to "Solved"

Last edited by bakunin; 09-13-2013 at 03:04 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Redirecting output using if with awk

I have this line were I am selecting some fields from one file and creating a new file for the selected data. awk -F "\"*,\"*" '{print $1"," $2}' folderone/list.txt > folderone/qlist.txt This works, but then from this new file I want it to create a new file where it separates data: $2 >5 it... (2 Replies)
Discussion started by: rluna
2 Replies

2. Shell Programming and Scripting

Redirecting the output

For example, if we run the below command, symcfg list -thin -pool , results in an output most of the times and if the out is generated i'm able to redirect the output to a file. but sometimes it doesnt result any output and even though the output is being redirected, i can see "No Thin Pools "... (2 Replies)
Discussion started by: web2moha
2 Replies

3. Shell Programming and Scripting

redirecting output using if-then-else in awk

I am trying to filter records based on number of "|", delimiter in my application. If number of "|" is greater than 14 its a bad record, else its a good record. I have to redirect output to two different files based on the if-then-else evaluation in AWK. if number of | in file_0 > 14 ... (2 Replies)
Discussion started by: siteregsam
2 Replies

4. Shell Programming and Scripting

Redirect output to tar.gzip

I would like to make a listing of files in a large directory and output it to tar.gz. Is it possible to do this in one command? For example; I would like the text output from this command to be outputted to a directory.tar.gz file. ls -al -R /bigdir Is it possible to do it in memory... (5 Replies)
Discussion started by: lewk
5 Replies

5. Shell Programming and Scripting

Redirecting output to file

Hi, Below is the whole string which is to be redirected to the new file. su - oracle -c "exp $user/$pass file=/oracle/oradata/backup/exp_trn_tables_`date +%d_%b_20%y_%H_%M_%S`.dmp log=/oracle/oradata/backup/exp_trn_tables_`date +%d_%b_20%y_%H_%M_%S`.log tables=table1,table2 statistics=none" ... (3 Replies)
Discussion started by: milink
3 Replies

6. UNIX for Dummies Questions & Answers

gzip produces different output from the same input

Hi there, I'm puzzled. Compressing the same file (same name, same md5sum) at two different times will produce a different output. I mean the md5sum of the resulting .gz files are different. Does it make any sens to any of you? I'd like some explanations if you know what's going on. Thanks... (4 Replies)
Discussion started by: chebarbudo
4 Replies

7. Shell Programming and Scripting

help redirecting output from mailbot

Hello...I'm having problems redirecting output from a script from a mailbot. It is a perl script that has the email sent to op_shipper piped into it. I am receiving the email with sendmail and here is what my alias looks like for the script am I having problems with in /etc/aliases: ... (3 Replies)
Discussion started by: kuliksco
3 Replies

8. Shell Programming and Scripting

Redirecting OUTPUT

Hi, I want to move the output of a command/script to a file as well as to to be displayed on stdout. Can anybody help me in this. Thanks in advace .. -Chanakya M (1 Reply)
Discussion started by: Chanakya.m
1 Replies

9. UNIX for Advanced & Expert Users

redirecting the output of aspell

Hi, I have 2 identical servers both running aspell but for some reason I can't redirect the output to a file on one of them. This is what I'm trying to do: echo feck | aspell -l > errors.txt On one machine this works fine but the other it doesn't (the file is created but it is empty). ... (6 Replies)
Discussion started by: leekb
6 Replies

10. UNIX for Dummies Questions & Answers

Redirecting the startup output

Is there any way to redirect the output of the startup of a sun E250. Im basically trying to troubleshoot some init scripts and it would be useful to have a log of the startup output. (3 Replies)
Discussion started by: blakmk
3 Replies
Login or Register to Ask a Question