[lug] linux/tcsh question
stimits at idcomm.com
Mon Apr 1 19:14:29 MST 2002
Keith Herold wrote:
> Well, I tried your tests and redirecting just files is fine (although I got
> a 'file 'foo'' does not exist using rpm; I replaced foo with every shell
> name I could think of), it's only when I run my code and try to redirect its
> output. I suppose the code could be blocking; the input sources are a file
> (hardcoded in) and some network ports(created by the code at runtime) but,
> the sendto and receive calls are after some printing. It doesn't seem like
> the program is working at all when I redirect the output, since I ran one in
> the background and then ran top; the program name doesn't show up. I also
> ran ps -aux and it keeps reading 0:00 for TIME.
> Why should redirection cause the problem? If I don't try to redirect, it
> all runs perfectly (I don't ever have input from stdin).
Perhaps buffers are not flushing. Try sending all output to stderr in
the program code, rather than stdout (since stderr is not buffered). Or
else use some unbuffered stream. You could even run it in gdb and single
step it once it gets where you are interested. You can set the arguments
to your program run with the "set args ..." command, and even use the |&
tee LogFileName.txt in addition (there are a few creative ways to work
in gdb). Which reminds me, this program isn't trying to background is
D. Stimits, stimits at idcomm.com
> > -----Original Message-----
> > From: lug-admin at lug.boulder.co.us [mailto:lug-admin at lug.boulder.co.us]On
> > Behalf Of Tkil
> > Sent: Monday, April 01, 2002 6:09 PM
> > To: lug at lug.boulder.co.us
> > Subject: Re: [lug] linux/tcsh question
> > >>>>> "Keith" == Keith Herold <Herold at Colorado.EDU> writes:
> > Keith> Any other ideas?
> > are you absolutely sure that you're not blocking, waiting for input?
> > anyway, on a solaris box:
> > | $ tcsh
> > | > echo "foo" > tmp1
> > | > ls -al tmp1
> > | -rw-r--r-- 1 tfoiani dev 4 Apr 1 17:05 tmp1
> > | > cat tmp1
> > | foo
> > | > exit
> > which seems to do the trick.
> > on this linux box...
> > | bash$ rpm -qf `which tcsh`
> > | tcsh-6.10-6
> > | bash$ tcsh
> > | set: No match.
> > | tcsh% echo "foo" > tmp1
> > | tcsh% ls -al tmp1
> > | -rw-r--r-- 1 tkil users 4 Apr 1 18:07 tmp1
> > | tcsh% cat tmp1
> > | foo
> > | tcsh% exit
> > which also does what i expect. try the above test?
> > t.
> > _______________________________________________
> > Web Page: http://lug.boulder.co.us
> > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Web Page: http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
More information about the LUG