Hi,
I am facing a queer situation, when i run the below script it starts up multiple forked process and hangs the unix server , we had to reboot the server once. Can someone pls help me understand why the script is causing multiple processes to start . If i run ps -ef rename.sh , after i start it and even cancel it (ctrl+c) still i see numerous multiple processes starting
Script name: rename.sh
#!/bin/sh
(
echo "Script `$basename $0` started at `date`"
echo " "
echo "Merging files A and B at `date`"
## merge 1
merge_files.ksh /dummy/test/files file_list_Atxt N N file_list_A.txt
echo "Status (file_list_A) = $?"
echo " "
merge_files.ksh /dummy/test/files file_list_Btxt N N file_list_B.txt
echo "Status (file_list_B) = $?"
#
echo " "
#
echo "Merging files C and D at `date`"
## Merge 2
merge_files.ksh /dummy/test/files file_list_Ctxt Y N file_list_C.txt
echo "Status (file_list_C) = $?"
echo " "
merge_files.ksh /dummy/test/files file_list_Dtxt Y N file_list_D.txt
echo "Status (file_list_D) = $?"
echo " "
echo "Merging of files Done at `date`"
echo "-----------------------------------------------------------"
) >> log_file.log
above script when i run seems to go in loops and forks out multiple porcesses quite fast. The embedded script "merge_files.ksh" which actually merges the files is fine as it runs perfectly fine independently with NO issues at all. The embedded merge_files.ksh takes 5 parameters (as can be seen above when calling it) - file dir path, file pattern name, header flag (Y if header is there and N if not), Footer flag (same as header flag, Y and N), final name of then merged file.
can someone pls guie me as to why the above script is going in loops and forking multiple processes ?