Nested calls

Hi all,
I have two questions:

  1. I have a script (call it A) that call another script (call it B) which in turn call another script (call it C). The strange thing is that when script C hangs script A exists (i.e., will not appear when I call ps command to list all the running processes). Is my observation is correct ? if so, how I call prevent A from disappearing?
  2. Is there a max. number of nesting when calling procedures?
    Thank you in advance
    Best Regards
  1. No, you must be in error. I do that all the time. Unless script C worked very hard to locate and explicitly kill script A, script A should be fine.

  2. There is no limit imposed by the shell, but computers are finite state machines. Eventually you will run out of process table entries or swap or some other resource.

Thank you very much

Hi again,
I have script A, that calls script B, in turn script B calls ftp. When ftp hangs only process A is shown when typing ps -ef command, script B is no longer exist. How can I prevent that. since I understand from the previous discussion that this is not possible. However, this occurs with me as shown in the snap shot below (which is taken at Aug. 8th) script A is ftpDC_lock and script B is called ftpDC (not shown). What ftpDC_lock do is it check if ftpDC is running if yes it will not fire ftpDC otherwise it will call it.
Thank you in advance
Best Regards

#date
Thu Aug 8 08:54:15 UTC 2002
# ps -fuboaadm
UID PID PPID C STIME TTY TIME COMD
boaadm 391 1 0 Jul 27 console 0:00 -ksh
boaadm 3798 3797 0 Jul 27 ? 3:09 oracleA P:4096,3,6,
boaadm 3797 1 0 Jul 27 ? 0:23 both -d
boaadm 325 1 0 Jul 27 ? 0:00 monitor 1024000 1024000 60 0
boaadm 3799 3796 0 Jul 27 ? 0:00 oracleA P:4096,3,6,
boaadm 496 391 0 Jul 27 console 0:05 runmenu50 boa -c AT386:AT386 -m p
boaadm 26251 247 0 Aug 03 ? 0:00 sh -c /usr/boa/bin/ftpDC_lock.sh >>/usr/boa/log/ftpDC_lock.log 2>&1
boaadm 491 1 0 Jul 27 console 0:00 vtlmgr
boaadm 3796 1 0 Jul 27 ? 0:00 bout -h24 -s10 -d
boaadm 499 496 0 Jul 27 ? 0:11 oracleA P:4096,6,9,
boaadm 26260 26253 0 Aug 03 ? 0:00 /usr/boa/bin/ftpDC_lock.sh
boaadm 2598 491 0 Jul 27 vt01 0:00 ksh
boaadm 26253 26251 0 Aug 03 ? 0:00 /usr/boa/bin/ftpDC_lock.sh
boaadm 26331 26260 0 Aug 03 ? 0:00 ftp -n
#

boaadm 26331 26260 0 Aug 03 ? 0:00 ftp -n

In the line above, 26331 is the pid of the ftp process, and 26260 is the pid of the parent of the ftp process. Should that parent die, the ppid will switch to 1 and init will become the new parent. Since the ppid is not 1, the parent process has not died.

This means one of two things:

1) You are mistaken and there simply is no script B. Script A itself is invoking ftp. (There may be a script B that does something else and then exits, but it didn't invoke that ftp process.)

2) There was a script B, but instead of running ftp, it did an "exec ftp". The exec command causes the new program to overlay the old one. You can never return from an exec. The old program is gone.

Thank you again for your help...
Actually I am the person that program all these scripts. Therefore, I am sure that script A will first check if script B is running is Yes it will do nothing otherwise script B will be called. In turn script B will call ftp using the following command
ftp -n
In this case PID of the parent was not 1 but on other occusion it is 1. Thank what makes me confused...

Best Regards

Hi...
I discovered the reason why process B diappear from the set of processes wjen using "ps -ef" . In the code of script A, I call script B by just typying its name (w/o sh) since it is excutable. When I use "sh A" it appears in the set of perocesses. Do you why this happens? I mean the effect of sh?
Thanks