Intension to give 0777 is to assign the permissions to the newly created directories.
Even i have tried without this, it gives the same error. As follows:
mkdir "/clocal/mqbrkrs/user/mqsiadm/varun/ClientSecurity/$line"
Even using "ksh -x dir_script" it gives the same error without tracking details. it gives the segmentation fault(coredump) in the next line when i try to execute the above command.
Something is strange here !!
"dirs" contains the list of names, which are going to be used while creating the directories.
cat dirs -->
CFCONNECT
BVF
ONLINEPAY
ECP
EFT
These are the simply names, which will be used to create directories. These names are constant string, which are then assigned to variable "line" in the script. ($line)
Ya, you are right this time, its not the reason of Segmentation fault - coredump error.
If i am not wrong, core dump comes when there is some problem with memory allocation or memory address resolution. Is there could be any other reason for that ?
Did you try to remove the parentheses from the invocation of the function, like taran suggested?
Can you successively remove lines from the script and get it to work without bombing?
Segmentation violation is a fairly unspecific error, it means the program ended up writing to memory it shouldn't write to, but the number of possible root causes for such behavior is large. Basically it's a programming error under any circumstances; the program should catch the error and report a more meaningful diagnostic, rather than plunge ahead into code which doesn't work.
Ya, it worked out when removed the braces () while calling the function defined. I don't know why and how this worked out as in other scripts i call functions with braces and it works perfectly fine. I am using AIX5.3 version.
Anyways solution to this problem I got, thanks for all.
But then, if you could help in resolving Open Question, why and how function calls are different ? Sometimes it works with braces () and sometimes it doesn't work.