Sponsored Content
Top Forums Shell Programming and Scripting Background execution of a script Post 302138679 by porter on Wednesday 3rd of October 2007 03:28:13 AM
Old 10-03-2007
Try putting /bin/ksh at the start on The2ndScript.sh then you don't have to keep refering to it.

The stdout of the background process will go to the file, when the task finishes the file will be closed.

That's all that happens.

I personally would go for your 2nd form, I try and always put "&" at the very end of the line to avoid confusion.
 

10 More Discussions You Might Find Interesting

1. Programming

execution in background

hey im having trouble understanding how to execute commands in the background. i did some research and saw that you only have to fork and not wait for the child to finish. in another case you have to change the process group. i ve really tried both of them but i just cant get them to work. ... (0 Replies)
Discussion started by: mile1982
0 Replies

2. UNIX for Advanced & Expert Users

Running script in background

When I run the following snippet in background #!/bin/ksh while do echo "$i" sleep 10 i=`expr $i + 1` done My job got stopped and it says like + Stopped (SIGTTOU) ex1 & I did "stty tostop" as suggested in many of the post but still not working... (3 Replies)
Discussion started by: shahnazurs
3 Replies

3. Shell Programming and Scripting

Expect Issue Serial Forground Execution vs Concurrent Background Execution

I have an expect script that interrogates several hundred unix servers for both access and directories therein using "ssh user@host ls -l /path". The combination of host/path are unique but the host may be interrogated multiple times if there are multiple paths to test. The expect script is run... (2 Replies)
Discussion started by: twk
2 Replies

4. Shell Programming and Scripting

Running a unix script(which is calling another script inside that) in background

Hi all, I am having a script ScriptA which is calling a script ScriptB in the same server and copying files to second server and have to execute one script ScriptC in the second server. THis First script ScriptA is the main script and i have to execute this process continously. for Keeping... (2 Replies)
Discussion started by: rohithji
2 Replies

5. Shell Programming and Scripting

Problem running a program/script in the background from a script

Hi all, I have a script that calls another program/script, xxx, to run in the background. Supposedly this program at most should finish within five (5) minutes so after five (5) minutes, I run some other steps to run the script into completion. My problem is sometimes the program takes... (5 Replies)
Discussion started by: newbie_01
5 Replies

6. Shell Programming and Scripting

running the script in background

I have a script called startWebLogic.sh which I was running in the background but the problem is which I used the command :- ps -elf | grep "startWebLogic.sh" | grep -v grep to find the process id but I was unable to find the process id for this script and when I checked from the front end the... (3 Replies)
Discussion started by: maitree
3 Replies

7. Shell Programming and Scripting

snoop script in background

Hi I want to write a script for snoop which can do snoop for 30 min and then process should be killed automatically I am using below codes #!/usr/bin/ksh snoop -d igb0 -o /opt/temp/abc.pcap sleep 1500 kill -9 `ps -ef|grep -i snoop |grep -v grep|awk '{print $2}'` But process is not... (3 Replies)
Discussion started by: anish19
3 Replies

8. Solaris

Script on Solaris spawning 2 processes for one shell script execution

Hi, I am having a shell script on Solaris 10 which has a while loop as shown below. #!/usr/bin/ksh # while do sleep 60 done Name of the shell script is coldcentric.sh. I executed script /DATAWAREHOUSE/LOAD/Scripts/coldcentric.sh from a command task in Informatica worklow as... (3 Replies)
Discussion started by: chekusi
3 Replies

9. Shell Programming and Scripting

Shell Script for continuously checking status of a another script running in background, and immedia

Hi, I want to write a script which continuously checking status of a script running in background by nohup command. And if same script is not running then immediately start the script...please help.. i am using below command to run script nohup system_traps.sh & but in some... (9 Replies)
Discussion started by: ketanraut
9 Replies

10. Shell Programming and Scripting

Running script in background

Hi, I wrote a KSH script and running it on HP-UX machine I am running one script in background. My script is at location $HOME/myScript/test/background_sh When I view my script in background with psu commend > psu | grep background_sh I see following output UID PID PPID C ... (1 Reply)
Discussion started by: vaibhav
1 Replies
CATCHOUT(3PVM)							  PVM Version 3.4						    CATCHOUT(3PVM)

NAME
pvm_catchout - Catch output from child tasks. SYNOPSIS
C #include <stdio.h> int info = pvm_catchout( FILE *ff ) Fortran call pvmfcatchout( onoff, info ) PARAMETERS
ff File descriptor on which to write collected output. onoff Integer parameter. Turns output collection on or off. info Integer status code returned by the routine. Values less than zero indicate an error. DESCRIPTION
The routine pvm_catchout causes the calling task (the parent) to catch output from any tasks spawned after the call to pvm_catchout. Char- acters printed on stdout or stderr in children tasks are collected by the pvmds and sent in control messages to the parent task, which tags each line and appends it to the specified file. Output from grandchildren (spawned by children) tasks is also collected, provided the children don't reset their PvmOutputTid. If option PvmShowTids (see pvm_setopt) is true (nonzero), output is printed as shown below, tagged with the task id where the output origi- nated: [txxxxx] BEGIN [txxxxx] (text from child task) [txxxxx] END The output from each task includes one BEGIN line and one END line, with whatever the task prints in between. If PvmShowTids is false, raw output is printed with no additional information. In C, the output file descriptor may be specified. Giving a null pointer turns output collection off for any subsequently spawned child tasks. (Any existing output collection will still proceed at the child tasks, until they exit or change theirPvmOutputTid or related set- tings - see man page for pvm_setopt().) In Fortran, output collection can only be turned on or off (again only for subsequently spawned child tasks), and is always logged to the stdout of the parent task. If pvm_exit is called while output collection is in effect, it will block in order to print all the output, until all tasks sending the given task output have exited. To avoid this, output collection can be turned off by calling pvm_catchout(0) before calling pvm_exit. pvm_catchout() always returns 0. EXAMPLES
C: #include <stdio.h> pvm_catchout(stdout); Fortran: CALL PVMFCATCHOUT( 1, INFO ) SEE ALSO
pvm_exit(3PVM), pvm_setopt(3PVM), pvm_spawn(3PVM) 13 July, 1994 CATCHOUT(3PVM)
All times are GMT -4. The time now is 04:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy