Reputation: 2456
is it possible to assign execute permission for a file with the help of umask. As I google then find umask is not just the difference between 666 and assigned permission but it converts the digits to rwx then compare with umask by converting umask to rwx and the difference is given as assigned permission.
For example:
File have default 666 (rw-rw-rw-
), if umask is 002 (-------w-
) then write permission will remove from others. while umask 001 (--------x
), so it will have no effect on permissions.
So how can I assign execute permission with umask?
Upvotes: 4
Views: 4371
Reputation: 249133
You can't. umask is used to reduce permissions, not to increase them. It sounds like you're asking how to make the default permission include the executable (x) bit for any new file created. This is really not a good idea, and it isn't supported (at least not by umask).
Upvotes: 6