Here IFILE, OFILE are file handlers. we can make changes of the file with the help of file handler.
Here i used three arguments open function, You can use like below. Dont confuse with this. This is just an alternate way. open file accepts three arguments.
we can use select function to select the output stream(STDOUT or FILEHANDLE).
After all the print statement will write to outfile since we have selected the default output stream as OFILE.
If you want to print the msg to STDOUT. You have to select,
Cheers,
Ranga
Last edited by rangarasan; 04-06-2012 at 09:28 AM..
This User Gave Thanks to rangarasan For This Post:
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)
Hi all,
I have a c++ program which is running fine but has some printfs which its spews on to the screen, which I need for debugging.
But, I execute this program through a java, i.e I run a java program which actually launches my c++ executable and when it does this, I see none of my printfs... (1 Reply)
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)
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 |... (5 Replies)
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)
I want to split big files based on a pattern to stdout.
Although csplit works well for me splitting the output into separate files (e.g. xx00, xx01, xx02, ...), the following is not working as expected:
<code>
# assuming pattern occurs less than 100 times
csplit bigfile '%pattern%'... (2 Replies)
Can somebody explain to me why the diff output is not going to stderr?
Yet when I issue a diff from the command line the return code is -ne 1.
I am guessing diff always writes to stdout???
Is there away I can force the difff to write to stderr USING THE CURRENT
template. If possible, I... (5 Replies)
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)