06-10-2017
@jgt: How then would you retrieve the children's exit stati?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have the following two Korn shell scripts:
SHELL1.ksh
#!/usr/bin/ksh
nohup sas /abc/123/sasprogram1.sas &
SHELL2.ksh
#!/usr/bin/ksh
./SHELL1.ksh
wait
nohup sas /abc/123/sasprogram2.sas &
My goal is to run SHELL1.ksh within SHELL2.ksh. SHELL1.ksh runs sasprogram1.sas. I would like... (1 Reply)
Discussion started by: sasaliasim
1 Replies
2. Shell Programming and Scripting
Hi
I have written a script using ftp to get files from one server and copy them to 2 dirrerent servers. I wish to call this script from a parent script that will check the number of files copied and run a check sum for each file. As the filenames for the files in the get portion of the script... (3 Replies)
Discussion started by: Andy82
3 Replies
3. Shell Programming and Scripting
I have two shell scripts : A.sh and B.sh
A.sh
echo "In A"
exec B.sh
echo "After B"
B.sh
echo "In B"
The output is : In A
In B
I want the output : In A
In B
After B (4 Replies)
Discussion started by: suchismitasuchi
4 Replies
4. Shell Programming and Scripting
Hello everyone,
I'm trying to write a script, i would like to say the child kills the parent,
how would i do that? (2 Replies)
Discussion started by: jessy21
2 Replies
5. AIX
If I have a file/folder that a user does not have permission to and I try to rename it, it removes the entire parent folder. At that point it is only visible in a ls. (Not a ls -l, file, more, cd). It happens on every filesystem. This is Aix 5.3
$ cd test
$ ls -la
total 0
drwxr-xr-x 2 root ... (4 Replies)
Discussion started by: scriptr2be
4 Replies
6. Shell Programming and Scripting
Hi everyone
i am very new to linux , working on bash shell.
I am trying to solve the given problem
1. Create a process and then create children using fork
2. Check the Status of the application for successful running.
3. Kill all the process(threads) except parent and first child... (2 Replies)
Discussion started by: vizz_k
2 Replies
7. Shell Programming and Scripting
Hi All,
I have a parent shell script A and a child shell script B.
1). If a command i.e a mysqdump fails in shell script B fails then I trap the error with this code
if ]
then func_exit "Failed to export the cleaned DB1.${MYDBNAME} database to the ${MYARCHIVEDIR} directory"... (1 Reply)
Discussion started by: daveu7
1 Replies
8. Shell Programming and Scripting
I am having a parent scripts which reads a file with child scripts name.
I need to read one by one child script , execute it and
1. If child script fails send mail to the team with the log file
2. If the child script executes fine then proceed with the next child script execution.
#!... (3 Replies)
Discussion started by: nw2unx123
3 Replies
9. Shell Programming and Scripting
#!/usr/local/bin/bash
set -vx
/prod/HotelierLinks/palaceLink/bin/PalacefilesWait /prod/HotelierLinks/palaceLink/bin/prodEnvSetup 03212013 &
if
then
echo "fatal error: Palace/HardRock failed!!!!" 1>&2
echo "Palace Failed" | mail -s "Link Failed at Palace/HardRock" -c... (1 Reply)
Discussion started by: aroragaurav.84
1 Replies
10. Shell Programming and Scripting
hi,
i want to call a child shell script from a parent shell script. the child will be running for 5 mins. normally when the child is running, parent will wait till the child completes. so in the above case parent will be paused for 5 mins. is there a way so that the parents does not wait for the... (3 Replies)
Discussion started by: Little
3 Replies
LEARN ABOUT ULTRIX
setpgid
setpgid(3) Library Functions Manual setpgid(3)
Name
setpgid - set process group (POSIX)
Syntax
#include <sys/types.h>
int
setpgid(pid, pgrp)
pid_t pid, pgrp;
Description
The function is used to either join an existing process group or create a new process group within the session of the calling process (see
Upon successful completion, the process group ID of the process that has a process ID which matches pid is set to pgrp. If pid is zero,
then the call applies to the current process. In addition, if pgrp is zero, the process ID of the indicated process is used.
This function is available only in the POSIX environment.
Return Values
The function returns 0 when the operation is successful. If the request fails, -1 is returned and the global variable indicates the rea-
son.
Diagnostics
The function fails and the process group is not altered if one of the following occurs:
[EACCES] The value of the pid argument matches the process ID of a child process of the calling process and the child process has
successfully executed an function.
[EINVAL] The value of the pgrp argument is less than zero or is not a supported value.
[EPERM] The process indicated by the pid argument is a session leader.
The value of the pid argument matches the process ID of a child process of the calling process and the child process is not
in the same session as the calling process.
The value of the pgrp argument does not match the process ID of the process indicated by the pid argument and there is no
process with a process group ID that matches the value of the pgrp argument in the same session as the calling process.
[ESRCH] The value of the pid argument does not match the process ID of the calling process of a child process of the calling
process.
See Also
getpgrp(2), setsid(2)
setpgid(3)