Re: Saving all xterm output to a file
On Sat, 7 Feb 2009, Gary Johnson wrote: ../run 1 Joiner default 21 results.dat I think that has to be written this way: ../run 1 Joiner default results.dat 21 But if you (the OP) wants to see what's going into that file, you should tee, like this: ../run 1 Joiner default 21 | tee results.dat hmm - yes (I had at hand a script which does the latter, and couldn't recall the detail needed for the former, which seemed to be what OP requested). -- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/
Re: Saving all xterm output to a file
On Sun, Feb 8, 2009 at 6:35 AM, Thomas Dickey wrote: hmm - yes (I had at hand a script which does the latter, and couldn't recall the detail needed for the former, which seemed to be what OP requested). Redirects are processed left-to-right. So this: command foo 21 says send stdout into file foo and then send stderr (file descriptor 2) wherever stdout (file descriptor 1) is going. So they both go into the file. If you swap them, like this: command 21 foo that says send stderr wherever stdout is going, and then send stdout into file foo. Which means stderr goes to the screen like usual and the 21 doesn't do much in this case. But since pipes are set up before any of the redirects, this command: command 21 foo | othercommand will send stdout into a file while piping stderr into the other command, and this one: command 21 | othercommand will pipe them both together. -- Mark J. Reed markjr...@gmail.com -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/
Re: Possible issue with X-start-menu-items : XWin fails to start when launched from start menu icon
I reported the exact same problem in my mail titled - Bug: xinit: XWin Server shortcut won't work if Cygwin not in C: I had a default HOME but installed Cygwin at d:\cygwin. Updating the starts in field to d:\ fixes the problem. - Original Message From: Simon McQueen s...@prismtech.com To: cygwin-xfree@cygwin.com Sent: Friday, February 6, 2009 6:27:14 PM Subject: Possible issue with X-start-menu-items : XWin fails to start when launched from start menu icon Hi all, I have performed a complete cygwin install from scratch today. cygcheck output is attached. Please note that my specific user home is not the Windows default. It's e:\sm, hence my ~ is /cygdrive/e/sm. Cygwin is installed in the default location of c:\cygwin. Attempting to launch XWin Server from the start menu icon does not launch a shell or produce the running XWin widget in the system tray. I've acknowledged the below: s...@beatrice ~ $ startxwin.bat startxwin.bat - Starting on Windows NT/2000/XP/2003 The system cannot find the path specified. The system cannot find the path specified. s...@beatrice ~ $ pushd /cygdrive/c /cygdrive/c ~ s...@beatrice /cygdrive/c $ startxwin.bat startxwin.bat - Starting on Windows NT/2000/XP/2003 s...@beatrice /cygdrive/c $ ... in the second instance XWin starts OK. The comments in the batch file explain why this is the case. Examining the properties of the C:\Documents and Settings\All Users\Start Menu\Programs\Cygwin-X\XWin Server shortcut that I used when trying to launch X from the start menu I note that the Start in field is unpopulated. This contrasts with C:\Documents and Settings\All Users\Start Menu\Programs\Cygwin-X\xterm where this field has the value c:\cygwin\bin. If I populate this field in the XWin Server shortcut with c:\cygwin\bin the shortcut works as expected and X launches OK. I presume (but am unable to verify) that this would still be the case for users in the more typical case of having their homes on c:. Thanks for reading. Cheers, -- Simon McQueen s...@prismtech.com OpenFusion CORBA OpenSplice DDSskype:simonmcqueen?add http://www.prismtech.com/middleware callto://+441914979966 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation:http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/ -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/
Re: Saving all xterm output to a file
Sorry, I'm not entirely sure I understood all that, but I wanted to give an update. I wrote a script and ran over 250 tests over last night using this syntax: ./run 1 Joiner default 21 | tee 2_7_09_results.dat Only one of these tests gave output. Mark, if I understand you correctly, the | tee should be at the end? I will try that today. A few more details about the system, in case any of them matter. All of this is running on a MacBook Pro that is running Windows XP in Bootcamp. What the run program does is actually start up a few different processes, one of which I wrote, to control a robot in a simulation package. The program that I wrote has bunch of printout statements that I need to see to debug why it isn't working and to take data once it is. I should mention that what I have been doing is completely closing out XWin after every run and re-opening it. I'm not sure if this will cause problems, and since it was test #67 that gave results last night, I don't think that would be the problem, but I'm going to try just closing bash and xterm between runs today. -- View this message in context: http://www.nabble.com/Saving-all-xterm-output-to-a-file-tp21894608p21898633.html Sent from the cygwin-xfree mailing list archive at Nabble.com. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/
Re: Saving all xterm output to a file
teddybouch wrote: Sorry, I'm not entirely sure I understood all that, but I wanted to give an update. I wrote a script and ran over 250 tests over last night using this syntax: ./run 1 Joiner default 21 | tee 2_7_09_results.dat Only one of these tests gave output. Mark, if I understand you correctly, the | tee should be at the end? I will try that today. A few more details about the system, in case any of them matter. All of this is running on a MacBook Pro that is running Windows XP in Bootcamp. What the run program does is actually start up a few different processes, one of which I wrote, to control a robot in a simulation package. The program that I wrote has bunch of printout statements that I need to see to debug why it isn't working and to take data once it is. I should mention that what I have been doing is completely closing out XWin after every run and re-opening it. I'm not sure if this will cause problems, and since it was test #67 that gave results last night, I don't think that would be the problem, but I'm going to try just closing bash and xterm between runs today. If you really want to prove this is an xterm issue (which seems unlikely to me as this really revolves about what bash is doing), you should compare the behaviour between running the command under an xterm and running it under some other terminal emulator (e.g. the 'cygwin bash shell' menu shortcut which starts bash inside the native 'DOS window') It was working alright, but then I realized that it wasn't getting all the output that ought to be there. Now, it has progressed to the point that I'm not getting any of the printout statements at all - they don't appear in the xterm window or in the file. It sounds like your output is gradually getting less and less. But you don't really say what's changing here: the scripts you are running, the environment you are running them in, or just the output? -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/
Re: Saving all xterm output to a file
Okay, I'm digging a little deeper, and I think that I have noticed some things that might be helpful and I've created some files that might shed some light. The files below are output from what I'm running through xterm. Auto indicates simulations in which the output was automatically teed to a file as well as the file, while manual indicates that I ran the simulation without having it output to a file and cut-and-paste the output to the text file. Good indicates that the simulation ran the way that I wanted it to, and bad indicates that there was an unrelated error that caused the simulation to fail. The file labeled with BadOut ran the way that I wanted, but this problem that I'm trying to fix came up where the output didn't go to the file. http://www.quickfilepost.com/download.do?get=2aeda11324087e4b50df06b338aa32fa Output_Auto_Bad.txt http://www.quickfilepost.com/download.do?get=51d9196b285962f05ab40ce620d1a75c Output_Auto_Good.txt http://www.quickfilepost.com/download.do?get=6922453eb0a8cbf34d0188ebd8d9c3bc Output_Auto_Good_BadOut.txt http://www.quickfilepost.com/download.do?get=cf14ab8cd7f2767f2ea4cfbb49c8544b Output_Manual_Bad.txt http://www.quickfilepost.com/download.do?get=dae384fed148e62ada7d5c02661b68b1 Output_Manual_Good.txt The most useful thing is to look at the first lines of each down to where it says Adm. I noticed that the output from this first part is consistent no matter if the output I need shows up or not - the same initialization stuff shows up. The funny thing is that that initialization stuff is unique to the different processes that are starting. Now, the program that outputs Adm is the same program that should be creating all the output that I want to save, so I'm not sure that this theory holds water, but I wanted to throw it out there. -- View this message in context: http://www.nabble.com/Saving-all-xterm-output-to-a-file-tp21894608p21903611.html Sent from the cygwin-xfree mailing list archive at Nabble.com. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/
Re: Saving all xterm output to a file
teddybouch wrote: Jon TURNEY wrote: If you really want to prove this is an xterm issue (which seems unlikely to me as this really revolves about what bash is doing), you should compare the behaviour between running the command under an xterm and running it under some other terminal emulator (e.g. the 'cygwin bash shell' menu shortcut which starts bash inside the native 'DOS window') I'm not really partial to proving that this is an xterm issue - I just want to get it working the way I need it to. Right after I write this email I'm going to make another version of my control program that writes directly to a file and see if that will give me everything that I need. I took your advice and tried it under the cygwin bash shell and got the same problem, so I assume that it's not an xterm issue, but as you suggest, a bash issue. If this isn't the place to find help for that, could someone direct me to the correct venue, please? For non-X issues, you want the main Cygwin list. But before jotting off a note there, see below. As to the issue of changing output, I'm sorry that the parameters for the different results were ambiguous. The input was the same for all of them. The change in output is not a progressive thing - it's just that sometimes the printf statements in my code get written to the specified file and other times they do not. Interestingly enough, the printf statements in the portion of the code that I didn't write do get output consistently. They are each followed by called to fflush(stdout) - might this have something to do with it? This has _everything_ to do with it. You're obviously suffering from buffered I/O. Employ the same technique as you've found in other areas and I expect your program will output everything like you expect when you expect it. -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 429-6305 - FAX Holliston, MA 01746 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/
Re: Saving all xterm output to a file
That's it! If I just throw some of the fflush commands in here and there in strategic places, I get all the output I am looking for up to those statements. Why would this be needed sometimes and not others? -- View this message in context: http://www.nabble.com/Saving-all-xterm-output-to-a-file-tp21894608p21906401.html Sent from the cygwin-xfree mailing list archive at Nabble.com. -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/
Re: Saving all xterm output to a file
teddybouch wrote: That's it! If I just throw some of the fflush commands in here and there in strategic places, I get all the output I am looking for up to those statements. Why would this be needed sometimes and not others? It's always needed if you must have output at a particular point in the execution. If that's not a requirement, then it shouldn't be necessary since the buffer should be flushed at normal program end. If that's not happening, that suggests something in your program is holding the stdout handle open, it has set the buffer size to something extraordinarily large, or you've triggered a bug. If you believe it's a bug, please create a simple test case in C that demonstrates the problem. Send it to the Cygwin list with an explanation of the problem. -- Larry Hall http://www.rfk.com RFK Partners, Inc. (508) 893-9779 - RFK Office 216 Dalton Rd. (508) 429-6305 - FAX Holliston, MA 01746 -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://x.cygwin.com/docs/ FAQ: http://x.cygwin.com/docs/faq/