Cygwin not waiting for program in background (solved)


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Cygwin not waiting for program in background (solved)
# 1  
Old 07-02-2010
Cygwin not waiting for program in background (solved)

Hello, I know this isn't exactly a Unix question, but I wasn't able to find much information elsewhere.

I'm trying to run a program in the background using Cygwin on a Windows machine, then use the wait command to pause before proceeding. Unfortunately, as I've confirmed using ps aux, the process is marked as 'done' before it's actually complete. As a consequence, the final output of the program is not logged (log close occurs before program is done).

To be specific, the program is Stata, and I call it with

run STATA /b dofile.do &
wait

The output itself does complete successfully, but it isn't logged. I'm a Linux beginner as much as a Cygwin beginner. Any clue how I might get around this?

---------- Post updated at 05:12 PM ---------- Previous update was at 03:54 PM ----------

Found a solution:

Buchbinder, Barry (N - RE: [OT?] make bash script wait for called program to finish?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Solved] Background and foreground colors for xterm

Hi all, I used the code given by cfajohnson on this forum to generate background colors for xterm. Thanks cfajohnson... (sorry wasnt allowed to past the complete url) n=200 ## adjust to taste: higher value, lighter background n1=$(( 256 - $n )) bg=$( printf "#%x%x%x\n" $(( $RANDOM % $n1 +... (2 Replies)
Discussion started by: carv_13
2 Replies

2. UNIX for Dummies Questions & Answers

[Solved] Check for a file and keep waiting for 30 mins

Hi All! I want to have a shell script that checks for a file in a particular folder and then if the file is not found it should wait for 30 minutes. Again check for the file, if it FOUND then successfuly exit the shell script stating the file is found. Else it should continue to wait. ... (4 Replies)
Discussion started by: akshay01987
4 Replies

3. Shell Programming and Scripting

Waiting for the background process to finish

Hi, I have on shell script which internally calls more than one scripts which run in background. These scripts cannot be modified to run in foreground. eg. myscript.sh -> bulk_launcher.sh -> acq_launcher.sh -> bulk_loader.sh I want the calling shell script myscript.sh to wait till the... (7 Replies)
Discussion started by: AB10
7 Replies

4. Shell Programming and Scripting

Waiting for an arbitrary background process (limiting number of jobs running)

Hi, I'm trying to write a script to decompress a directory full of files. The decompression commands can run in the background, so that many can run at once. But I want to limit the number running at any one time, so that I don't overload the machine. Something like this: n=0 for i in *.gz... (15 Replies)
Discussion started by: p.f.moore
15 Replies

5. Windows & DOS: Issues & Discussions

"Striping" the background of an Rxvt/Urxvt window in Cygwin

To get this: https://www.unix.com/members/silversleevesx-albums-incidental-shot-glass-picture127-termshot-rxvt-rootless.png out of Cygwin's rxvt, you have to tweak your /cygwin/etc/x11/app-defaults/rxvt file, which is here:... (0 Replies)
Discussion started by: SilversleevesX
0 Replies

6. Programming

Run external program in background

Hi, in my program i need to run an external program in background.I am aware that there are at least 2 alternatives for this: 1)fork+exec 2)system("program &"); I have read several posts about this,and they all tend to suggest to use fork+exec (and that's what i am doing now). I have some... (2 Replies)
Discussion started by: Zipi
2 Replies

7. Shell Programming and Scripting

Waiting for a background process to finish

Hello, I am a novice shell script programmer. And facing this problem any help is appreciated. I m writing a shell script and running few commands in it background as I have to run them simultaneously. Sample code : sql_prog & sql_prog & sql_prog & echo "Process Completed" Here... (2 Replies)
Discussion started by: vineetbhati
2 Replies

8. Programming

parent not waiting until child complete executing another program through execl()

Hi, I am calling a program that greps and returns 72536 bytes of data on STDOUT, say about 7000 lines of data on STDOUT. I use pipe from the program am calling the above program. Naturally, I execute the above program (through execl() ) throught the child process and try to read the... (4 Replies)
Discussion started by: vvaidyan
4 Replies

9. UNIX for Advanced & Expert Users

How to set background colours for a cygwin console

Hi, I need to set the background colors for cygwin console, when I do ssh to production boxes. This should be done through commands.. Please suggest me asap. Thanks in advance. (3 Replies)
Discussion started by: praveen_b744
3 Replies

10. Programming

How to complie a c++ program in Unix or Cygwin?

Can I use gcc to compile a piece of c++ code? Do I need to name the file that contains the code as .cpp? Thank you (14 Replies)
Discussion started by: meili100
14 Replies
Login or Register to Ask a Question
Inline-Support(3)					User Contributed Perl Documentation					 Inline-Support(3)

NAME
Inline-Support - Support Information for Inline.pm and related modules. DESCRIPTION
This document contains all of the latest support information for "Inline.pm" and the recognized Inline Language Support Modules (ILSMs) available on CPAN. SUPPORTED LANGUAGES
The most important language that Inline supports is "C". That is because Perl itself is written in "C". By giving a your Perl scripts access to "C", you in effect give them access to the entire glorious internals of Perl. (Caveat scriptor :-) As of this writing, Inline also supports: - C++ - Java - Python - Tcl - Assembly - CPR - And even Inline::Foo! :) Projects that I would most like to see happen in the year 2001 are: - Fortran - Ruby - Lisp - Guile - Bash - Perl4 SUPPORTED PLATFORMS
"Inline::C" should work anywhere that CPAN extension modules (those that use XS) can be installed, using the typical install format of: perl Makefile.PL make make test make install It has been tested on many Unix and Windows variants. NOTE: "Inline::C" requires Perl 5.005 or higher because "Parse::RecDescent" requires it. (Something to do with the "qr" operator) Inline has been successfully tested at one time or another on the following platforms: Linux Solaris SunOS HPUX AIX FreeBSD OpenBSD BeOS OS X WinNT Win2K WinME Win98 Cygwin The Microsoft tests deserve a little more explanation. I used the following: Windows NT 4.0 (service pack 6) Perl 5.005_03 (ActiveState build 522) MS Visual C++ 6.0 The "nmake" make utility (distributed w/ Visual C++) "Inline::C" pulls all of its base configuration (including which "make" utility to use) from "Config.pm". Since your MSWin32 version of Perl probably came from ActiveState (as a binary distribution) the "Config.pm" will indicate that "nmake" is the system's "make" utility. That is because ActiveState uses Visual C++ to compile Perl. To install "Inline.pm" (or any other CPAN module) on MSWin32 w/ Visual C++, use these: perl Makefile.PL nmake nmake test nmake install Inline has also been made to work with Mingw32/gcc on all Windows platforms. This is a free compiler for Windows. You must also use a perl built with that compiler. The "Cygwin" test was done on a Windows 98 machine using the Cygwin Unix/Win32 porting layer software from Cygnus. The "perl" binary on this machine was also compiled using the Cygwin tool set ("gcc"). This software is freely available from http://sources.redhat.com/cygwin/ If you get Inline to work on a new platform, please send me email email. If it doesn't work, let me know as well and I'll see what can be done. SEE ALSO
For general information about Inline see Inline. For information about using Inline with C see Inline::C. For sample programs using Inline with C see Inline::C-Cookbook. For information on writing your own Inline Language Support Module, see Inline-API. Inline's mailing list is inline@perl.org To subscribe, send email to inline-subscribe@perl.org AUTHOR
Brian Ingerson <INGY@cpan.org> COPYRIGHT
Copyright (c) 2000-2002. Brian Ingerson. Copyright (c) 2008, 2010, 2011. Sisyphus. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.18.2 2012-11-19 Inline-Support(3)