Help in changing the Parent id of a script


 
Thread Tools Search this Thread
Operating Systems Solaris Help in changing the Parent id of a script
# 1  
Old 02-23-2011
Help in changing the Parent id of a script

HI
I want to run a script as new process. for example, I have two script A and B. From A I am calling B, but When I do ps -ef for the script B the parent ID should not be A' ID.
Please help me


Thanks & Regards
Ramu
# 2  
Old 02-24-2011
There is one command known as "disown" in solaris. That is used to detach the process from its parent id.

like if there is any job %1

then

disown %1

will detach the job from parent id.

let me know if it helps.
# 3  
Old 02-24-2011
disown is a shell builtin - not a standalone utility. It is only for job control and does not actually detach a process from its parent.

All user processes have a parent ID. Why do you think that the parent ID of script B should not be that of script A?
# 4  
Old 02-24-2011
You can assign init process as parent for your script, by running:
Code:
nohup -p pid_of_B

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to capture exit code of child script and send it to parent script?

#!/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

2. Shell Programming and Scripting

Get parent script name

Hi, my question is similar to my earlier post from 2009 which is Closed now https://www.unix.com/shell-programming-scripting/141945-get-current-parent-script-name.html script child.sh can be called by any script say, parent1.sh, parent2.sh, parent3.sh,... child.sh should be able to say what's... (1 Reply)
Discussion started by: ysrini
1 Replies

3. Shell Programming and Scripting

Stop child script by stoping parent script

Hi everyone, I have this problem with a script I'm writting. I want to execute a code running in the background several times through a script. I am writting it like that parent_script for a in 1 2 3 4 5 do exec test -n $a done What I want to do is when parent_script is killed,... (0 Replies)
Discussion started by: geovas
0 Replies

4. Shell Programming and Scripting

Parent Script exiting with child script

PARENT SCRIPT #!/bin/ksh # . $HOME/.profile . /etl/estdm2/DEV/scripts/DM_ENV_VARS.ksh DEV DB echo "CALLING CHILD SCRIPT" . /${SCRIPT_DIR}/DM_CHild.ksh -x HRDATA.dat -e $sEnv -d Wait_Time *****THE PARENT SCRIPT EXITS HERE ******** *****whether the file is found or not******* ... (2 Replies)
Discussion started by: sumeet
2 Replies

5. Shell Programming and Scripting

Get current and parent script name

Hi, i have a script a.sh that calls b.sh Both take parameters a.sh { b.sh p1 p2 p3 } b.sh { GIVEN_CMD="`basename $0` $@" echo "${GIVEN_CMD} } Now when i run: a.sh q1 q2 It prints only a.sh q1 q2 Inside b.sh, how can i print both the script names and their parameters passed? (6 Replies)
Discussion started by: ysrini
6 Replies

6. Shell Programming and Scripting

Script, child kills parent

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

7. Shell Programming and Scripting

full path of a file situated either in parent's dir. or parent's parent dir. so on...

hi experts(novice people can stay away as it is no child's game), i am developing a script which works like recycle bin of windows. the problem i am facing is that when ever i am trying to delete a file which is situated in parent directory or parent's parent directory i am unable to... (1 Reply)
Discussion started by: yahoo!
1 Replies

8. Shell Programming and Scripting

returning to the parent shell after invoking a script within a script

Hi everybody, I have a script in which I'm invoking another script which runs in a subshell. after the script is executed I want to return to the parent shell as some variables are set. However i'm unable to return to my original shell as the script which i'm calling inside is invoked in... (5 Replies)
Discussion started by: gurukottur
5 Replies

9. Solaris

How to know parent script

:confused: Can some one advise me how to know the parent script from a child script. ex: i can call 1.sh or 2.sh from 3.sh so wot is the command to know from which script 3.sh is called from? (1 Reply)
Discussion started by: raki
1 Replies

10. Shell Programming and Scripting

return valuse from child script to parent script

Hi, I am trying to return a value from child script to a parent script just as a function does. The child script will look for a file and if exists will return 1 else 0. I need to capture the status 1 from child script in the parent script and proceed further. if 0, i need not do... (1 Reply)
Discussion started by: borncrazy
1 Replies
Login or Register to Ask a Question