I was able to get in touch with the coder who wrote this part of the app, and he thinks that possible cout and cerr are re-directed to dev/null somewhere. This was written at least 10 years ago, so his recollections are a bit hazy. Apparently the child process runs more or less like a Daemon and things like standard streams are poorly defined.
That sounds quite possible.
Quote:
He suggested adding a verbosity flag, and if that doesn't work, creating an fstream for debugging with a hard path, instead of using cout. Something like,
None of this explains why it works in windows cygwin, except that the src for the child main function is rather different in windows as compared to linux.
Not really the same program at all, then. I bet that's it.
Quote:
What should I look for in the src that would be an indication that cout is going to dev/null, or somewhere other than the terminal?
Look for close( or dup( or dup2( or freopen( or STDIN_FILENO or STDOUT_FILENO or STDERR_FILENO. Also look for /dev/null, of course.
Quote:
In all cases, it just outputs numbers, the location outputs 0, 1, and 2.
Crap. I forgot to do ls -l instead of ls.
Last edited by Corona688; 03-30-2011 at 03:14 PM..
Hi
I want both standard output and standard error of my command cmd to go to the same file log.txt. please let me know the best commandline to do this.
Thanks (2 Replies)
Hello,
I am very new in writing low level programming in C. I am trying to get an output in Linux 2.6.17.6 gentoo platform, but I don't get any output.
I am trying to do the following:
I am trying to scan a word and print its content at the standard output by using sscanf and printf.
I... (6 Replies)
Hello all
Im using CC: Sun C++ 5.6 2004/07/15 and using the -library=stlport4 when linkning im getting
The fallowing error :
Undefined first referenced
symbol in file
std::ostream &std::ostream::operator<<(std::ios_base&(*)(std::ios_base&))... (0 Replies)
hey guys, I have two files both with two columns, I have already created an
awk code to ignore certain lines (e.g lines that start with 963) as they wou
ld begin with a certain string, however, the rest I have added together and
calculated the average.
At the moment the code also displays... (3 Replies)
Hi all,
I implemented a C++ program and successfully compiled and ran on my laptop. However when I copy my code to another machine (school's sun machine), it didn't run properly. I can compile and run, but cout does not print everything. I used cout in a loop where it iterates no more than 20... (5 Replies)
Hello Friends,
Can some one help me how to redirect output of a file to both a file and std output? All the help would be greatly appreciated.
Regards
Sridhar (1 Reply)
Hi all,
I have a script that bulk loads thousands of lines of data. I need to log the output during the execution of the script.
I know I can redirect (">") the output to a file; however, I want the output going to both the screen and the log file.
I thought I could use pipe to pipe the... (10 Replies)
Hi guys, i have a new problem, even in scripting on KSH.
Given a string by standard INPUT (keyboard), i need to replace each character i print with this one '#' .
It's to camouflage password while digiting on command line.
For example:
----------------------------------
prompt$ ... (3 Replies)
Hi !
I have this input:
12{11}{11110}{80}3456
{123}15{60}9876{8083}34
I try to work on individual numbers between braces.
3 possible cases (here I used colours to be clearer only):
- there is no "0" among the characters between braces: so we don't touch anything.
- there is a "0" among... (4 Replies)