umask

Hi,

I have a doubt on the umask values.

Why is the UMASK value is different from file and directory?
Suppose if the umask value is 0022. The file permissions for a newly created file is 644 and the file permissions for a newly created directory is 755.
My doubt is why can't it be the 755(same like directory) for file also?
How can I provide the execute permission (default) to a file through UMASK?

Thanks in advance.

that depends on how you are creating the files. if you are creating a file using vi, the vi program may not assign certain permissions (x for owner, w for group and others) for newly created files

if you are still in doubt, read this to know how umask is implemented