Displaying Result to a Text File


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Displaying Result to a Text File
# 1  
Old 10-04-2010
Data Displaying Result to a Text File

Hi;

I am scripting in Shell and i want to write output (on screen) to a text file?

Code:
 
... | tee gcsw/output.txt

doesnot work?

SmilieSmilie
# 2  
Old 10-04-2010
Please define "doesnot work".
# 3  
Old 10-04-2010
Try redirection.... If i think i have understood correctly what you want to do... you can try

"your script" >> /tmp/output.txt

this should pretty much work
# 4  
Old 10-04-2010
i'm scripting some codes, but when i type

Code:
... | tee /gcsw/output.txt

but no files are created??

Code:
"your script" >> /tmp/output.txt

was also invalid??
# 5  
Old 10-04-2010
can u paste here the line of code that u r using for redirecting the output to another file...?
# 6  
Old 10-04-2010
Quote:
Originally Posted by gc_sw
i'm scripting some codes, but when i type

Code:
... | tee /gcsw/output.txt

but no files are created??
Either a file named /gcsw/output.txt is created or an error message states why it wasn't.
# 7  
Old 10-04-2010
without some information regarding the issue you are facing, im sorry i cannot be of much help
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Average result of text file

Hi all I have created a script to allow me to gain a number of file times and how long they take to execute. I have been asked to get the average time for the log. The log will update every 5 minutes and never be empty. 141 152 157 161 168 169 171 179 202 207 229 651 666 714... (3 Replies)
Discussion started by: simpsa27
3 Replies

2. Shell Programming and Scripting

awk to parse file and display result based on text

I am trying using awk to open an input file and check a column 2/field $2 and if there is a warning then that is displayed (variantchecker): G not found at position 459, found A instead. The attached Sample1.txt is that file. If in that column/field there is a black space, then the text after... (6 Replies)
Discussion started by: cmccabe
6 Replies

3. Shell Programming and Scripting

Hit multiple URL from a text file and store result in other test file

Hi, I have a problem where i have to hit multiple URL that are stored in a text file (input.txt) and save their output in different text file (output.txt) somewhat like : cat input.txt http://192.168.21.20:8080/PPUPS/international?NUmber=917875446856... (3 Replies)
Discussion started by: mukulverma2408
3 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

How to output thre result to a text file?

Dear All I have a script file like the following: ..... ..... Variable_1 = 888 Variable_2 = 999 ..... MyExternalProgram Myfile ..... The line MyExternalProgram Myfile will generate some number, Say 777 Now I hope I can output the result of above codes to a text file,... (2 Replies)
Discussion started by: littlewenwen
2 Replies

6. Shell Programming and Scripting

Append Text in Result File Name

Hi Below command is returning the list of files which having this string "MTL_SYSTEM_ITEMS". find . -name "*"|xargs grep -il MTL_SYSTEM_ITEMS Ex: Above command is returing 2 files (Out of 10 files 2 files having this string). ./file1.txt and ./file2.txt Here I want to append... (3 Replies)
Discussion started by: balajiora
3 Replies

7. UNIX for Dummies Questions & Answers

How can I append a text at end of file after displaying the file

I have a file "sample.txt" with the content as below: Hi This is a Sample Text. I need a single command using cat which serve the following purpose. 1.display the contents of sample.txt 2.append some text to it 3. and then exit But, all should be served by a sinle command.:confused: (1 Reply)
Discussion started by: g.ashok
1 Replies

8. UNIX for Dummies Questions & Answers

Displaying Text

Hi guys! I am very much new to UNIX...and I was just wondering on how you would display this text format in UNIX with only just one command : Text 1 Text 2 Text 3 Texts are in aligned vertically in such format...Thanks for your help :) (8 Replies)
Discussion started by: Knowledge_Xfer
8 Replies

9. Shell Programming and Scripting

Displaying text file in browser - perl

Don't know why this didn't get posted before but... I am having issues displaying a log file in the browser using perl and I can't get it to display at all, All i get is WHITE (blank page). I have proper permissions in my cgi-bin directory and everywhere else. So I know that's NOT the issue. ... (3 Replies)
Discussion started by: Dabheeruz
3 Replies

10. Shell Programming and Scripting

Displaying text file in browser - perl

I am having issue dispalying text file in browser using perl. Here is my code: #!/usr/bin/perl print "content-type: text/html \n\n"; open (FH , "access.log") || die "Blah $!"; while (<FH>) { print $_ ; } I have correct permissions and everything. The weired thing is when I... (1 Reply)
Discussion started by: Dabheeruz
1 Replies
Login or Register to Ask a Question