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
File::Spec::Cygwin(3pm) 				 Perl Programmers Reference Guide				   File::Spec::Cygwin(3pm)

NAME
File::Spec::Cygwin - methods for Cygwin file specs SYNOPSIS
require File::Spec::Cygwin; # Done internally by File::Spec if needed DESCRIPTION
See File::Spec and File::Spec::Unix. This package overrides the implementation of these methods, not the semantics. This module is still in beta. Cygwin-knowledgeable folks are invited to offer patches and suggestions. canonpath Any "" (backslashes) are converted to "/" (forward slashes), and then File::Spec::Unix canonpath() is called on the result. file_name_is_absolute True is returned if the file name begins with "drive_letter:", and if not, File::Spec::Unix file_name_is_absolute() is called. tmpdir (override) Returns a string representation of the first existing directory from the following list: $ENV{TMPDIR} /tmp $ENV{'TMP'} $ENV{'TEMP'} C:/temp Since Perl 5.8.0, if running under taint mode, and if the environment variables are tainted, they are not used. case_tolerant Override Unix. Cygwin case-tolerance depends on managed mount settings and as with MsWin32 on GetVolumeInformation() $ouFsFlags == FS_CASE_SENSITIVE, indicating the case significance when comparing file specifications. Default: 1 COPYRIGHT
Copyright (c) 2004,2007 by the Perl 5 Porters. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2014-01-06 File::Spec::Cygwin(3pm)