files created with different permissions

Hi,

Within a SQL file i am calling 5 shell scripts in back ground and redirecting their outputs to different log files in a specific directory.
Now when I observed is, the log files are created with different permissions even though i did not do any thing specific.

For example in run_scripts.sql I am doing:
! nohup /u36/app/1SR/v69/111.sh > /nw_disk1/oradb/flatfile/log/111.log &
! nohup /u36/app/1SR/v69/222.sh > /nw_disk1/oradb/flatfile/log/222.log &
! nohup /u36/app/1SR/v69/333.sh > /nw_disk1/oradb/flatfile/log/333.log &
! nohup /u36/app/1SR/v69/444.sh > /nw_disk1/oradb/flatfile/log/444.log &
! nohup /u36/app/1SR/v69/555.sh > /nw_disk1/oradb/flatfile/log/555.log &

After the scripts are executed when i checked in /nw_disk1/oradb/flatfile/log directory: ls -ltr *.log

-rw-r--r-- 1 oracle dba 1059 Jul 16 06:15 111.log
-rw-r--r-- 1 oracle dba 1428 Jul 16 06:15 222.log
-rw-r----- 1 oracle dba 1059 Jul 16 06:15 333.log
-rw-r----- 1 oracle dba 1212 Jul 16 06:15 444.log
-rw-r----- 1 oracle dba 1129 Jul 16 06:15 555.log

How this is possible? Only first 2 log files have read permissions for others.

Thanks in advance.

Why don't you try to chmod the file when your script has executed writing to the output file?

Unless you own the files - and those are owned by oracle - your umask will not affect permissions on those files - in the case when they already existed to start with and you are just overwriting them. Or if you execute a umask statement somewhere in your code, obviously.