I am firing off some scripts from a main script,
It would be useful to put a bit of time between the two to clean up the output to the terminal.
I think this would work,
but this would not guarantee that the second command would finish before the script continues.
I'm not sure if this would work,
As I read it, the first command would execute in a sub-shell and the script would continue and sleep for 5. After that, the third command will execute in a subshell and then the script will wait for both sub-shells to return before it moves on.
Is this right??? Is there a better way to do this kind of thing??
These scripts don't need to run in any particular order, there output is to files and each script is independent. They just need a bit of time in between when they start, and they both need to finish before the script moves on. The issue is that these two scripts (hex1, hex2) fire off six instances of an application and each instance reports some start up data back to the terminal. Because of the way that they are started, all of that start up data is mixed up and garbled. I am trying to debug a bit and can't read printout to the terminal that I need to look at.
Each script starts three instances of the app and there is a bit of sleep time between each, so if I run just one script, that output is clear. It is only when I run both scripts at the same time that I get this mess. I could not run the second script in the background and wait a bit before starting it, but I need to make sure that both scripts finish before moving on.
If I do what I posted,
is this legal syntax? Will this start up hex1, wait for 30, start hex2, and then wait for both hex1 and hex2 to finish before moving on?
Yes your syntax is correct and typically hex2 will be run 30 seconds after hex1 was started.
As Corona688 pointed out you are at the mercy of the scheduler and system resources, etc. as to when the jobs will actually be allocated CPU and move into a running state. But since you are only worried about terminal overrun you can safely ignore this, the system would have to be in a pretty bad way for a background job to take any more than a second or two to start.
This User Gave Thanks to Chubler_XL For This Post:
Well the code above did work and I got clear printout from all six instances of my app. I was able to read the path that couldn't be found and correct the bug.
This came up a little in another thread. Can someone explain some why awk (I happen to use gawk) behaves as follows:
$ cat file
aaa
$ awk 'BEGIN {print x}' x=1
$ awk x=1 'BEGIN {print x}'
awk: fatal: cannot open file `BEGIN {print x}' for reading (No such file or directory)
$ awk -v... (6 Replies)
Hi All,
I would like to improve my bash scripting skill and found a problem which I do not understand. Task is to search and print files in directory (and subdirecories) which contains its own name. Files can have spaces in name.
This one works fine for files in main directory, but not for... (4 Replies)
Hello,
I've a little problem with one of my ksh scripts and I manage to narrow it to the script here:
#!/bin/ksh
writeLog()
{
paramHandle="unknown"
OPTIND=1
while getopts :i: option $*
do
case $option in
i) paramHandle=${OPTARG} ;;
esac
done
echo... (2 Replies)
I am calling a script from with another script and reading its output one line at a time (using <childscript> | while read line) in the parent script. If the output exceeds a predefined number of lines I want to kill the child shell from within the parent shell.
I decided to print the process ID... (2 Replies)
hi,
The following mail cmd executed successfully.
mailx -s 'subject' user@company.com < testfile.dat
However When i include this mail cmd in shell script it behave odd. Getting an error message mailx comand not found. (2 Replies)
Hi , I have a script that compares two string and prints the larger string , This is an extract of a biggers script that i have.
#! /bin/ksh
DT_STRING_CMP=20081221223440
DT_STRING=20071221223440
if ; then
echo "20081221223440"
fi
echo... (5 Replies)
Hi , I have a script that compares two string and prints the larger string , This is an extract of a biggers script that i have.
#! /bin/ksh
DT_STRING_CMP=20081221223440
DT_STRING=20071221223440
if ; then
echo "20081221223440"
fi
echo... (1 Reply)
hi frnds,
how to make the ssh service to behave as rsh.as we know ssh asks for passwd whereas the rsh doesnt.so how can i perform the followin operation
without being asked for passwd.
lets say i want to run the command "ls" on "remote_terminal"
$ssh remote_terminal ls
the above should work... (1 Reply)
The profile of the user is empty. Then before I run the script I want I run a parameter file that populates the variables for oracle.
ORACLE_HOME
ORACLE_BASE
ORACLE_SID
PATH
etc ...
But it seems that these variables are not making it to the shell I am in because when I do an echo on... (6 Replies)