Welcome, Guest. Please login or register.

Author Topic: Shell script problem  (Read 1215 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline dandelionTopic starter

  • Full Member
  • ***
  • Join Date: Sep 2003
  • Posts: 246
    • Show only replies by dandelion
Shell script problem
« on: January 28, 2004, 03:12:01 PM »
Hi all..

I need a bit of help with the script i'm writing. It doesn't do much, simply executes a file which then holds the process until the program finishes. The thing is, i need this program to be executed within another program, which means that the parent program is held up until the program it launches quits. However, the fact that the parent program is held up causes major problems.

So...what i'm trying to do is get the parent program to launch the other program without it effect its own operation. Is there a "new process" command or a way of doing this?

Hope this makes sense, didn't explain it very well!
MorphOS on MacMini
RISC OS on RPi
Dreaming of owning another classic.
 

Offline toblerone

  • Newbie
  • *
  • Join Date: Jan 2004
  • Posts: 1
    • Show only replies by toblerone
Re: Shell script problem
« Reply #1 on: January 28, 2004, 03:40:13 PM »
The command 'Run' perhaps?

Edit: And if you are using OS3.9, adding a '&' behind the command should do the exact same thing.

Program &

Whereas with Run you would type:

Run Program
 

Offline bloodline

  • Master Sock Abuser
  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 12113
    • Show only replies by bloodline
    • http://www.troubled-mind.com
Re: Shell script problem
« Reply #2 on: January 28, 2004, 03:48:32 PM »
aye.

Run mystoopidprogram >Nil:

and that will launch it in it's own shell, and keep it quiet.

Offline KennyR

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 8081
    • Show only replies by KennyR
    • http://wrongpla.net
Re: Shell script problem
« Reply #3 on: January 28, 2004, 03:51:16 PM »
To execute a program detached from a script, use Run.

Run >NIL: Foobar

This runs and detaches Foodbar and stops run itself from outputting anything.

Run >NIL: Foobar >NIL:

This makes the whole thing totally quiet, but isn't usually necessary - detached tasks mostly have nowhere to send their output to anyway.