Operating System - HP-UX
1833788 Members
2642 Online
110063 Solutions
New Discussion

Re: stdout file re-direction

 
abhijeet_7
Advisor

stdout file re-direction

Hello Gurus,
i have a query with "stdout" file.
i want to re-direct the output of stdout to a new file ..how can it be done?

secondly,
sometimes stdout is full or nothing gets wriiten in it..why is it so?
everytime i have to stop & start the application so that contents are written to "stdout"

Thanx & Regards,
ABHI K
we work, to become...not acquire
4 REPLIES 4
Noel Miranda
Frequent Advisor

Re: stdout file re-direction

stdout is associated with file descriptor 1.


So to redirect stdout, yuo need to use
1 > yourfile

I don't understand you second point. stdout does not get full. Whatever output there is, will be written to stdout. Also you error messages.
abhijeet_7
Advisor

Re: stdout file re-direction

Thanx noel,
i meant to say,if there is nothing being written to stdout,what can be the cause?

i nullify stdout daily through cron..
last night it got nullified as "stdout.date"
but new nullified stdout file was not showing any contents...( tail -f stdout)

i restarted the application..then everything went on smoothly...

this has happened 4th time in this month itself,where only thing i could do is to restart the application which ultimately hampers production system...

i have checked log files but it is not showing any error or debug messages or any warnings...

Regards
ABHI K
we work, to become...not acquire
Noel Miranda
Frequent Advisor

Re: stdout file re-direction

I still don't understand. DO you mean to say you have a ordinary file called stdout, or are you talking about the standard output device stdout?

If you are using an ordinary file by name "stdout", are you sure you are the only one with access to these files? Looks like someone else may be just deleting or moving these files. If this is done, then what you see happens. i.e. there won't be anything written to the file. And tail -f will show nothing.
Rodney Hills
Honored Contributor

Re: stdout file re-direction

Remember that some applications buffer their output in memory first, and only physically write the data to the output file when the application is closed or the buffer fills and it gets flushed to disk.

HTH

-- Rod Hills
There be dragons...