delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2004/10/04/22:08:43

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <F76C9B2DA2FC4C4CA0A18E288BBCBCF708217E1D@nihexchange24.nih.gov>
From: "Buchbinder, Barry (NIH/NIAID)" <BBuchbinder AT niaid DOT nih DOT gov>
To: cygwin AT cygwin DOT com
Subject: RE: Run program in background.
Date: Mon, 4 Oct 2004 22:08:34 -0400
MIME-Version: 1.0
X-IsSubscribed: yes

At Sunday, October 03, 2004 6:24 PM, Moises Deangelo wrote:
> Please
> 
> I did a program in C.
> 
> That program needs to run for a long time, because of this it is ideal
> that he works on background.
> 
> I do not have been managing do that.
> 
>  is there some command? Any lib, anything
> 
> I thank the help.
> 
> Moises Deangelo.

It is not clear that what I wrote below is what you really want.  But in
case it is ...

If you want to write a program that puts itself in the background, I can't
help you.  But if you want to just run it in the background ...

(1)
Open a new console/bash window.
Start the program.
Continute your work in other windows.
(Note: This is not really running in the background, but it has the same
effect: start a program and continue with other work.)

(2)
Start the program like this:
	$ program &
(Note: You won't be able to exit from that shell until program finishes.)

(2a)

(3)
If you use bash as your shell:
Start the program.
	$ program
Stop the program by hitting control-Z.
Put the program in the background
	$ bg
Other shells with job control can do similar things, though the specifics
may vary.
(Note: This is equivalent to (2).  Also, you won't be able to exit from that
shell until program finishes.)

(4)
Investigate cygstart.exe.  See
	$  cygstart --help

(5)
If you have X installed, inventigate run.exe.


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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019