Way to save output result of a program into another new file...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Way to save output result of a program into another new file...
# 1  
Old 04-14-2010
Way to save output result of a program into another new file...

Does anybody know any alternative way to save output result of a program into another new file?
I got try the command below:
Code:
[home]program_used input_file > new_output_file
[home]program_used input_file >> new_output_file

Unfortunately, both the ">" and ">>" is not work at this case to save the output result file.
The "program_used" is a binary file as well. Thus unable to edit its contents Smilie
My purpose just want to save the output result of "program_used" into another "new_output_file".
Thanks for any advice to archive my desired goal.
# 2  
Old 04-14-2010
Does following giving you any output on the screen :

Code:
[home]program_used input_file 
[home]program_used input_file

because ">" and ">>" will redirect the very same output which you get on your screen to the new_output_file.If after running the above program you are not getting any output on your screen then you can't redirect it to new_output_file.Then in that case you need to use different method.
Pl let us know...
# 3  
Old 04-14-2010
Hi, thanks for your reply.
Code:
[home]program_used input_file

The above command able to give me an output in my screen. But I unable to save it into another output file Smilie
Do you got any idea how I can archive it?
# 4  
Old 04-14-2010
how about - do you see anything in 'new_output_file.stderr' and 'new_output_file.stdout' files?
Code:
program_used input_file 1> new_output_file.stdout 2> new_output_file.stderr

# 5  
Old 04-14-2010
Yaa Vgersh is right...
If you are unable to redirect the output with ">" or ">>" then I am a bit sure that the output you are getting is not the stdout.It should be stderror and you can trap it by using "2>" or "2>>" insted of ">" or ">>".

So, use this instad..
# 6  
Old 04-14-2010
Quote:
Originally Posted by patrick87
Hi, thanks for your reply.
Code:
[home]program_used input_file

The above command able to give me an output in my screen. But I unable to save it into another output file Smilie
Do you got any idea how I can archive it?

Also make sure that you have proper privileges to write in that particular location.
# 7  
Old 04-14-2010
Hi vgersh99,
After I try your command. It gives the following error message Smilie
Code:
-bash: new_output_file.stdout: No such file or directory



---------- Post updated at 08:06 PM ---------- Previous update was at 08:03 PM ----------

Haiz...
I also wonder why I can't save the output result into another new file Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Save value from output of Corestat and save in a list for each core

I am trying to modify the "corestat v1.1" code which is in Perl.The typical output of this code is below: Core Utilization CoreId %Usr %Sys %Total ------ ----- ----- ------ 5 4.91 0.01 4.92 6 0.06 ... (0 Replies)
Discussion started by: Zam_1234
0 Replies

2. UNIX for Dummies Questions & Answers

I save the result in a variable

I have friends that this command worked perfectly, but I would like to save the result in a variable, which I have not achieved var=prueba.txt echo $var | cut -d "." -f 1 prueba I need to do this but does not work me salida=echo $var | cut -d "." -f 1 echo "result:$salida" ... (8 Replies)
Discussion started by: tricampeon81
8 Replies

3. Homework & Coursework Questions

Save output into file bash scripting

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Hi there. i have created a program that in the end it will give output like this 1 2 3 4 5 10 9 ... (1 Reply)
Discussion started by: shdin271
1 Replies

4. Shell Programming and Scripting

Save result to a text file

Currently I have a perl code to combine two different files. #! /usr/bin/perl -w use strict; open FP1,"A.txt"; open FP2,"B.txt"; my ($l1,$l2); while(1) { $l1=<FP1>; chomp $l1; $l2=<FP2>; chomp $l2; last unless(defined $l1 or defined $l2); print "$l1 $l2\n"; } close FP2;... (4 Replies)
Discussion started by: Tzeronone
4 Replies

5. Shell Programming and Scripting

awk and save result on a different file

Hi, If I type: ls -l *txt | awk '{print $8}' I get the file listing if I am in the directory. If I try to do the same from a job flow, doing also other things, I can't do ls -l directory/*txt | awk '{print $8}' > directory/result.txt or echo ls -l directory/*txt | awk '{print... (8 Replies)
Discussion started by: essemario
8 Replies

6. Shell Programming and Scripting

"Time" command and save result in a file.txt

Hi, I'am using "time" to check execution time of some script. Is there any possibility to save time command result into a file ? (2 Replies)
Discussion started by: Physix
2 Replies

7. Shell Programming and Scripting

Save cURL verbose output to file or do it like browser "save as.."

hi there ! i have exactly the same problem like this guy here https://www.unix.com/shell-programming-scripting/127668-getting-curl-output-verbose-file.html i am not able to save the curl verbose output.. the sollution in this thread (redirecting stderr to a file) does not work for me.... (0 Replies)
Discussion started by: crabmeat
0 Replies

8. Shell Programming and Scripting

let curl output to stdout AND save to a file

hello hackers. i have a curl process running as cgi directly pushing stdout to the client. but i want to additionally save that stream to a file at the same time. any directions madly welcome. thanks in advance (3 Replies)
Discussion started by: scarfake
3 Replies

9. Shell Programming and Scripting

save the HTML result

Hi all, I am displaying my result in HTML format using tables. I want to save the results in file in the same format along with the table only. How do i do that in perl? I have attached the table structure . I want to save like that itself . with regards (2 Replies)
Discussion started by: vanitham
2 Replies

10. Solaris

terminal output - save to file?

I have a window open on my ultra 10 - a terminal window connecting to a server. Is there any way I can log all output to this window to a log file on my ultra 10 ? (2 Replies)
Discussion started by: frustrated1
2 Replies
Login or Register to Ask a Question