Re: Show window for BASH script run with /bin/run

2010-04-02 Thread J. David Boyd
JPMcGrath jpmcgr...@jpmcgrath.net writes:

 I am running a bash script under cygwin from within another (non-cygwin)
 program.  The script normally does not interact with the user, so I use
 /usr/bin/run when running the script to avoid having a bash window
 constantly popping up and going away.  However, if the script encounters an
 error, I need to show the user what went wrong.  What I am looking for is a
 way for the script to show the hidden window if it encounters an error. 
 Does anyone know how to do this?

 Thanks in advance.

Write the error output of the hidden script to a file that was removed
before the script ran.  If the file exists after the script exits, pop
it up and show the contents to the user.  If the file doesn't exist
after the script exits, everything is fine.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



RE: Show window for BASH script run with /bin/run

2010-04-02 Thread Buchbinder, Barry (NIH/NIAID) [E]
J. David Boyd sent the following at Friday, April 02, 2010 2:32 PM
JPMcGrath jpmcgr...@jpmcgrath.net writes:
 I am running a bash script under cygwin from within another
 (non-cygwin) program.  The script normally does not interact with the
 user, so I use /usr/bin/run when running the script to avoid having a
 bash window constantly popping up and going away.  However, if the
 script encounters an error, I need to show the user what went wrong.
 What I am looking for is a way for the script to show the hidden window
 if it encounters an error.
 Does anyone know how to do this?

 Thanks in advance.

Write the error output of the hidden script to a file that was removed
before the script ran. If the file exists after the script exits, pop it
up and show the contents to the user. If the file doesn't exist after
the script exits, everything is fine.

You might also look at the options available with cygstart.  Please note
that I've never had to do this, so I may be misunderstanding the man
page.

Good luck,

- Barry
  Disclaimer: Statements made herein are not made on behalf of NIAID.

--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



Re: Show window for BASH script run with /bin/run

2010-04-02 Thread JPMcGrath


J. David Boyd-2 writes:

 Write the error output of the hidden script to a file that was removed
 before the script ran.  If the file exists after the script exits, ...

I think you are assuming that I have access to the non-cygwin program that
launches the script, but that was written by someone else and I do not have
the source.

Thanks.
-- 
View this message in context: 
http://old.nabble.com/Show-window-for-BASH-script-run-with--bin-run-tp28121386p28124893.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple



RE: Show window for BASH script run with /bin/run

2010-04-02 Thread JPMcGrath


Buchbinder, Barry (NIH/NIAID) [E] writes:

 You might also look at the options available with cygstart.  Please note
 that I've never had to do this, so I may be misunderstanding the man
 page.

Thanks for that tip, but unfortunately, I cannot get cygstart to do the job. 
When I launch the script with cygstart --hide, it does run the window
hidden, but there does not seem to be any way to show the window again.  If
I run cygstart --show afterwards, it just launches another instance.

I am currently redirecting the output to a file, then launching notepad on
the file if there is an error, which works reasonably well.  But if I could
show the window, I could do that after a set amount of time, which would
deal with the script hanging as well.  That's not too likely, so I will live
with this for now.

Thanks for your help.


-- 
View this message in context: 
http://old.nabble.com/Show-window-for-BASH-script-run-with--bin-run-tp28121386p28124894.html
Sent from the Cygwin list mailing list archive at Nabble.com.


--
Problem reports:   http://cygwin.com/problems.html
FAQ:   http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info:  http://cygwin.com/ml/#unsubscribe-simple