• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

Submitting shell script in background.

Hi

I have an application that requires to execute a shell script in the background.

For example, the user will select print report, which is a seperate process and is run from a K Shell script. I need a way of running that shell script in the background, without the screen waiting for the process to complete. i.e. fire and forget. The calling screen will supply the full path of the shell script.

Is there a simple way of acheiving this in C on HP-UX and on Windows?

Pete
0
rintsp
Asked:
rintsp
1 Solution
 
stefan73Commented:
Hi rintsp,
Redirect the output and use nohup:

nohup your_script > /dev/null 2>&1 &

Cheers,
Stefan
0
 
sunnycoderCommented:
Hi rintsp,

for *nix use fork and exec

for windows use CreateProcess


Sunnycoder
0
 
rintspAuthor Commented:
Oops, sorry I should have closed this along time back, sunnycoder is the correct answer and points sorted!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Tackle projects and never again get stuck behind a technical roadblock.
Join Now