I'm assuming from what you say the program is running in the background, hence the issue with regards to knowing what it's finished .. how about something like;
Depending on your parameters you'll probably need something a little more complete than "cat parameters", but in principle this will wait for my_prog to finish even if it backgrounds ..
Or .. for a batch in parallel ..
'Course if they all finish around the same time, the output from "time" might be interesting to interpret ...
Hi,
I am new to Unix and shell programming.
I am trying to write a shell program to read 4 variables from command line.
For example,
Please enter your name: somebody
Please enter your address: address
plase enter your phone: phone
I'd like to save all threee variables in my program for... (3 Replies)
Hi all,
I'm running a simulator and I'm noticing an slow increase in memory for long simulations such that the simulation has to end because of a lack of memory. A colleague of mine ran Valgrind memcheck and reported that nothing of interest was reported other than known mem leaks. My advisor... (2 Replies)
Hi all,
I have a requirement in which a script invokes a Java program.
Lets say script ABC invokes a java program with cfg file a parameter.
This script takes 10 minutes to execute .
Like this ineed to run the program 10 times meaning 100 minutes if i do it sequentially.
If i open... (2 Replies)
Hi,
First i need to cd to this directory $SWDIR/util
Second i need to run the following either 4 times or 20 times
./swadm add_process 1 BG Y
how can i put this in a script which should ask for user input on how many times you want to run this
Thanks, (5 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
This is a problem I am having with my 2 semester senior project. I have a LAMP server running Ubuntu 9.10 with... (8 Replies)
Okay so I've got a command to start my java server up, but I want it to start at say 8:00AM and then stop at 11:00PM. In order to stop it I have to type stop and press enter in the terminal. I've been trying to get this to work and I'm having no luck. Here's my command:
#!/bin/bash
cd "`dirname... (2 Replies)
Hi,
I have a fortran program with serial and MPI version. I want to compare the time taken by these programs to run. I use ifort/gfortran compiler.
How to compare the time taken by each program to run? Is there any sample code for comparison?
Thanks,
rpd (1 Reply)
We have a program source C and is required to indicate how many times each function is called from the C program. also print the line number where there is a call.
I've tried something like this:
#!/bin/sh
for i in $*;do
if !
then
echo $i is not a C file.
else echo $i... (0 Replies)
Hi guys,
I have written a script that waits for a trigger file.
Then checks the time of the trigger.
if the trigger finished between 8pm and midnight then runs a job.
else it waits till 1am then runs a different job.
I am still very new to scripting so any suggestions to improve my... (4 Replies)
Discussion started by: twinion
4 Replies
LEARN ABOUT PLAN9
wait
WAIT(2) System Calls Manual WAIT(2)NAME
wait - wait for a process to exit
SYNOPSIS
#include <u.h>
#include <libc.h>
int wait(Waitmsg *w)
DESCRIPTION
Wait causes a process to wait for any child process (see fork(2)) to exit. It returns the pid of a child that has exited and fills in w
with more information about the child. W points to a Waitmsg, which has this structure:
typedef
struct Waitmsg
{
char pid[12]; /* of loved one */
char time[3*12]; /* of loved one & descendants */
char msg[ERRLEN];
} Waitmsg;
Pid is the child's process id. The time array contains the time the child and its descendants spent in user code, the time spent in system
calls, and the child's elapsed real time, all in units of milliseconds. All integers in a Waitmsg are formatted as right-justified textual
numbers in 11-byte fields followed by a blank. Msg contains the message that the child specified in exits(2). For a normal exit, msg[0]
is zero, otherwise msg is prefixed by the process name, a blank, the process id, and a colon.
If there are no more children to wait for, wait returns immediately, with return value -1.
SOURCE
/sys/src/libc/9syscall
SEE ALSO fork(2), exits(2), the wait file in proc(3)DIAGNOSTICS
Sets errstr.
WAIT(2)