I'm using PERL on windows NT to try to run an extract of data. I have multiple zip files in multiple locations. I am extracting "*.t" from zip files and subsequently adding that file to one zip file so when the script is complete I should have one zip file with a whole bunch of ".t" files in it.
... (2 Replies)
I am attempting within a for-loop, to have my shell script (Solaris v8 ksh) wait until a copy file command to complete before continueing. The specific code is:
for files in $(<inputfile.lst)
do
mv directory/$files directory/$files
ksh -m -i bg %%
wait $!
done
I am shaky on the... (3 Replies)
Hi,
Does anyone know how to make BASH provide a list of possible completions on the first tab, and then start cycling through the possibilites on the next tab?
Right now this is what I have in my .bashrc:
bind "set show-all-if-ambiguous on"
bind \\C-o:menu-complete
This allows... (0 Replies)
Hi All,
Am finding performance of my SD card using hdparm.
hdparm -tT /dev/BlockDev0
/dev/BlockDev0:
Timing cached reads: 1118 MB in 2.00 seconds = 558.61 MB/sec
HDIO_DRIVE_CMD(null) (wait for flush complete) failed: Inappropriate
ioctl for device
Timing buffered disk reads: 14... (0 Replies)
When running a command using the >(cmd) syntax in bash how do you wait for the command to complete before moving on in your script?
Here is a simple example:
zcat largefile.gz | tee >(wc && echo “HELLO”) > /dev/null
# I tried wait, here but it doesn't wait for the process in the subshell.... (8 Replies)
I have a script that runs a console/terminal command on the server and what is want is for each of the multiple success reports fed back from the clients (echo-ed out onto the conosle) to be counted and after x number of reports reboot the server.
The Details:
The command (program) is... (0 Replies)
Let's say I start process A.sh, then start process B.sh. I call both of them in my C.sh
How can I make sure that B starts its execution only after A.sh finishes.
I have to do this in loop.Execution time of A.sh may vary everytime.
It is a parameterized script. (17 Replies)
Hi All,
I have a question related to Shell scripting. In my shell script, I have following two commands in sequence:
sed 's/^/grep "^120" /g' $ORIGCHARGEDAMTLIST|sed "s;$;| cut -f$FIELD_NO1 -d '|' | awk '{ sum+=\$1} END {printf (\"%0.2f\\\n\", sum/100)}' >$TEMPFILE
mv $TEMPFILE $ORIGFILE... (3 Replies)
Hello all,
I tried to parralise my treatments but after a while 'ps -ef' display all child process <defunct> (zombie)
Parent bash script to process all files (>100000) in directory:
for filename in /Data/*.txt; do
./child_pprocess.sh $filename &
done
exit(0)I understand that the... (1 Reply)
Discussion started by: namnetes
1 Replies
LEARN ABOUT HPUX
waitid
waitid(2) System Calls Manual waitid(2)NAME
waitid - wait for child process to change state
SYNOPSIS DESCRIPTION
The function suspends the calling process until one of its children changes state. It records the current state of a child in the structure
pointed to by infop. If a child process changed state prior to the call to returns immediately.
The idtype and id arguments are used to specify which children will wait for.
If idtype is will wait for the child with a process ID equal to (pid_t)pid.
If idtypeis will wait for any child with a process group ID equal to (pid_t)pid.
If idtypeis will wait for any children and id is ignored.
The options argument is used to specify which state changes will wait for. It is formed by OR-ing together one or more of the following
flags:
Wait for processes that have exited.
Status will be returned for any child that has stopped upon receipt
of a signal.
Status will be returned for any child that was stopped and has been
continued.
Return immediately if there are no children to wait for.
Keep the process whose status is returned in
infop in a waitable state. This will not affect the state of the process; the process may be waited for
again after this call completes.
The infop argument must point to a structure. If returns because a child process was found that satisfied the conditions indicated by the
arguments idtype and options, then the structure pointed to by infop will be filled in by the system with the status of the process. The
si_signo member will always be equal to
RETURN VALUE
If returns due to the change of state of one of its children, 0 is returned. Otherwise, -1 is returned and is set to indicate the error.
ERRORS
The function will fail if:
[ECHILD] The calling process has no existing unwaited-for child processes.
[EINTR] The function was interrupted due to the receipt of a signal by the calling process.
[EINVAL] An invalid value was specified for options, or idtype and id specify an invalid set of processes.
APPLICATION USAGE
Threads Considerations
In a multi-threaded application, only the calling thread is suspended by
will not return until all threads in the process have reached the desired state. For example, if the or options are specified, will not
return until all threads in the process have terminated, stopped or continued respectively.
SEE ALSO exec(2), exit(2), wait(2), <sys/wait.h>.
CHANGE HISTORY
First released in Issue 4, Version 2.
waitid(2)