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 it's parent script command line
child.sh
parent1.sh
If i run this command:
parent1.sh p1 p2 p3
i should see the result:
My command line is child.sh c1 c2
My parent command line is parent1.sh p1 p2 p3
I took the 'cat /proc/$PPID/cmdline' line from 'frans' reply in the Closed thread
However /proc directory is not available
Our is HP-UX 11.11 box, where can i find the file that stored the cmdline information by process id?
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)
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 (3 Replies)
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)
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)
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)
: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)
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)