Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Semi-OT] Signal app to give stack trace ?



Dwayne Schultz <email@hidden> wrote:

#!/bin/sh
tail -f [...] &

This script quits immediately but the tail continues sending output to
the shell that started the script.

I have another script:
#!/bin/sh
java [...] &

This script also quits immediately but standard out appears to be lost
with it (which is why I couldn't get kill -QUIT to work).

This isn't as critical now but does any know what is going on here?
The script works as expected when I get rid of the '&'.

Eventually, you're going to have to learn more about Unix programming. A
few things are immediately relevant, though.

I think you missed my point but then again when re-reading my above post I wasn't being entirely clear. I wanted to know why tail was able to write to the outer shell (the one running interactively) but my java program wasn't.

As it turns out my program can write to the outer shell but for some reason the stack trace is getting lost. Evidently the signal handler isn't writing to stdout. At least not in the typical way. Bug?


I haven't checked your scenario. But normal Un*x programming dictates
that errors are printed to 'stderr', not 'stdout'.

If you want both streams to show up to the same place, redirect
them as follows:

$ app > app.log 2>&1

The end tells the shell to redirect stderr(2) to the same
place as stdout(1) which is a log file in this case.

Hopefully this isn't regurgitating information you already know.


--
----------------------------------------------------------
Out of the 10Base-T, through the router, down the T1, over the
leased line, off the bridge, past the firewall... nothing but Net.
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: [Semi-OT] Signal app to give stack trace ? (From: Dwayne Schultz <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.