not able to capture STDOUT


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers not able to capture STDOUT
# 1  
Old 04-24-2008
not able to capture STDOUT

I am using a third party API to get some real time feed. When I run the command it shows the results properly:

etd@mhs-apps5009 $ mamalistenc -m lbm -tport mamaqa -S MLALERTS -s KANA wFinancialStatus
Type CTRL-C to exit.
(null).MLALERTS.KANA Type: INITIAL Status OK
wFinancialStatus | 266 | CHAR | SDB-Restriction=4

<pressed ctrl-c>
etd@mhs-apps5009 $

But, when I try to redirect the output to a file nothing get captured.

etd@mhs-apps5009-d $ mamalistenc -m lbm -tport mamaqa -S MLALERTS -s KANA wFinancialStatus >out.txt

<pressed ctrl-c>
etd@mhs-apps5009-d $

Any ideas??

thanks for any help.
# 2  
Old 04-24-2008
Have you tried to use tee command yet?
# 3  
Old 04-24-2008
thanks vbe for pointing on tee.

well, its working to an extent, and only when I am invoking the command through a shell script like ./env_conf.sh |tee out.txt

Still wondering whats wrong with the command:
mamalistenc -m lbm -tport mamaqa -S MLALERTS -s KANA wFinancialStatus| tee out.txt
# 4  
Old 04-24-2008
Do a ps -ef |grep mamali
and then of the PID found, you may find why the tee is not giving expected output:
a (or more) new process(es) launched?
# 5  
Old 04-24-2008
On a tangential note, would it be useful at all to run it under script instead?
# 6  
Old 04-25-2008
yeah, now i am able to capture the output in a file.

script -q -c "mamalistenc -m lbm -tport mamaqa -S MLALERTS -s KANA wFinancialStatus" out.txt >/dev/null

thanks for every help Smilie
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Stdout in file

I cannot figure out what is wrong.... I have 3 files with IP addresses: file1 134.123.3.236 file2 134.123.3.235 file3 134.123.5.237 I type "prob1 Oops x2x3x4". Then my code creates file with name Oops and first line x2x3x4. Moreover, my code generate IP and it gives to file Oops as a second... (1 Reply)
Discussion started by: Manu1234567
1 Replies

2. Cybersecurity

How do I wipe stdout?

Today I used Terminal (invoked from Mac OS X 10.4.11) to view some data that is secured by a password. After exiting Terminal, it occurred to me that a vestige of the data displayed on my screen might reside in memory or in disk file ... the actual file used for stdout, for example. Do I need... (1 Reply)
Discussion started by: dcollins
1 Replies

3. UNIX for Dummies Questions & Answers

STDout

Hi, I have a program set to read in a text file, change certain characters and then print the altered version to the screen but does anyone know how to save the new version as another text file? And, if possible, how to specify the file name, and perhaps location? Thanks! (2 Replies)
Discussion started by: PerlNutt
2 Replies

4. Programming

Capture stdout from multiple processes

I have a number of binaries which I currenlty have no control over. They alright data to stdout. I would like to kick off any number of these binaries and capture and process their stdout. Doing this for one process is straight forward for example - comments and error checking removed for... (6 Replies)
Discussion started by: dvales
6 Replies

5. Shell Programming and Scripting

STDOUT in one line

Hi all, I got a file which contains this. aaaaaaaaaaaaaaaaaaaaaaaa test aaaaaaaaaaaaaa test aaaaaaaaaaa test aaaaaaaaaaaaaaaaa test aaaaaaaaaaaaaaaaaaaaa test aaaaaaaaa test aaaaa test and I want all test output in one row, ideally 3 spaces after the longest word. Thanks (4 Replies)
Discussion started by: stinkefisch
4 Replies

6. Programming

redirect stdout

hello again! i use dup2 to redirect stdout. I run what i want, now i want undo this redirection. how can i do that? thanx in advance (7 Replies)
Discussion started by: nicos
7 Replies

7. UNIX for Advanced & Expert Users

How to capture STDOut of script in a CGI script?

Hi Perl Experts, I am invoking a shell script thru a perl script and the perl script is cgi script.I need to capture the STDOUT of the shell script in the html page where I am invoking the script .?The shell script takes couple of mintutes to complete its execution .Mean while my html page does... (1 Reply)
Discussion started by: kittu1979
1 Replies

8. UNIX for Advanced & Expert Users

How to use gzip on stdout

Does anyone know how I can use gzip to zip a large log file on the fly. My simulation is currently logging a large file that I need for analysis at a later point. However the files are so huge that I may even run out of disk space. The content is mainly text so when compressed the files are... (2 Replies)
Discussion started by: mitch1710
2 Replies

9. Shell Programming and Scripting

Executing Stdout ???

Hiya all, Simple question - yet no simple answer im afraid ! Is there a way to execute a shell script (child) which returns one line and get the current (parent) shell to execute the stdout from the child ??? example child.sh #!/bin/sh echo "setenv DISPLAY xxx:03" parent_prompt>... (5 Replies)
Discussion started by: fawqati
5 Replies

10. UNIX for Dummies Questions & Answers

logging stdout

Hello I run a program that creates number of processes. Is there a way of viewing their standard output on terminal and logging it to a log file simultaneously? (3 Replies)
Discussion started by: masha
3 Replies
Login or Register to Ask a Question