Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

capture screen output (not tee, nor > )

Status
Not open for further replies.
Feb 12, 2002
80
0
0
NO
Hi,

I am running a C program in UNIX that outputs info to the screen. I can not edit the source code, but want the output to be available to other users other than me.

I have tried all of the following, all in csh (assuming "command" is the command run):

Code:
command | tee -a file.log
Code:
command > file.log
Code:
( command > file.log ) > & file.err
Code:
script
command

None of these let the program run, or so it seems. certainly get no results and the log files remian empty.

Any ideas of other methods to collect the output from a program that is normally sent to screen?

cheers,
lil'idiot
 
Do you have to capture it locally? Have you tried doing so by enabling logging in your terminal software?

Annihilannic.
 
I intended to log it locally but am open to suggestion.

Not sure what you mean by "enabling logging in to your terminal software" ... can I enable it sot hat other users can see one specific terminal window?
 
Anyway, if the C program write to /dev/tty, no i/o redirection will work for you.
Furthermore, I quite don't understand why you're still using an old buggy and deprecated shell like csh ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Try getting hold of kibitz for Solaris perhaps? It's a tool that allows you to share a terminal session between multiple users for training or demonstration purposes...

Annihilannic.
 
You might also consider the command: script
It will record everything that you do to a file of your choice.

The output wont be available until you end the script session. Also, if you were to edit the file, you would see all the control characters that were generate - IE ^M.

If you can live with those "restrictions", then:

Code:
script some.file
command
exit

will give you want you want.

Add a little color to your PUTTY terminal: faq52-6627
 
arg... will give you what you want.

Add a little color to your PUTTY terminal: faq52-6627
 
PHV said:
if the C program write to /dev/tty , no i/o redirection will work for you.
I do not have access to the C source code - is there anyway I can check if the C program writes to /dev/tty or elesewhere?

Annihilannic said:
Try getting hold of kibitz for Solaris
I'm working in a locked down environment - no chance of installing my own stuff [thumbsdown]

sbrews said:
You might also consider the command: script
Not a viable option, as the whole point of doing this is so that other users can read the output in real time ... ideally by tail -f the log file. As script does not flush out till the end of the session, this is pointless for my needs (-f option on script is not available).

[COLOR=red yellow]Any more ideas before I give up? I hate giving up ... [/color]
I can run it in other shells if anyone thinks that might make a difference?

 
Yeah - although it would have to be a BIG beamer ... we're all logging into the same system from multiple locations around Europe (UK, Netherlands, Norway). I was hoping they could just see the output of ONE terminal window .. doens;t seem like it should be sucha big deal.

And I still can't install any software to use shared desktop utilities - which isn't really a viable solution anyway ... I don't really want to broadcast my entire desktop to my Norwegian counterparts ...

Looks like I'm going to have to beg/borrow/steal/hack into the C-sourc code and take myself back to my brief crash cousre on C programing [sadeyes] ahh!


If anyone else comes up with a solution/idea then PLEASE let me know ...
 
Are you running a windows desktop? If so, you can use netmeeting. Once set up (should already be there, just not configured), you can share just a specific window, several windows or the entire desktop.

To see if netmeeting is on your pc
- click start
- click run
- in the dialog box type: conf.exe
- follow the prompts to do the base config
- share out the window(s) you want others to see

The person/people on the far end would also need to do the netmeeting base configuration so they can connect to you.

I understand the need for locked down environments but at the same time it makes it so damn hard to do anything.


Add a little color to your PUTTY terminal: faq52-6627
 
Your help is appreciated. We use netmeeting regularly here - but it is stil not a solution, just a work around.

It's very frustrating that the output is there on my screen but I can't log it ...

Ah well ...
 
Hi,

Sometimes, programmers, for some original reasons, does not write output to stdout but to stderr.
try this
Code:
command [red]2>&1[/red] | tee -a file.log
[/code}
 
Have you tried SharedX or doublevision? The screen command with -x might work.

Cheers,
ND [smile]
 
Turns out the redirect WAS working all along - just not fillign the log file for about 10 minutes or so ... I assume it was filling a buffer then writnig to the log file and waiting again ...


problem solved.

Thanks all for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top