- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: umask in HP-UX
Categories
Company
Local Language
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- This widget could not be displayed.This widget could not be displayed.This widget could not be displayed.This widget could not be displayed.This widget could not be displayed.This widget could not be displayed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2001 09:08 AM
04-03-2001 09:08 AM
umask in HP-UX
I have umask 022 set in my .profile file. when I create a directory, the file permission is drwxr-xr-x, which is correct. Now under this directory, I create a file, the file permission is -rw-r--r-- instead of -rwxr-xr-x. I donot want to use chmod command everytime.
1) How do I get -rwxr-xr-x on a file ?
2) I am also looking for file persmission -rwx------.
Can any one help me for setting the above two file permissions. I read the man pages, but still couldnot resolve the issue.
Thanks in advance
Bala
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2001 09:47 AM
04-03-2001 09:47 AM
Re: umask in HP-UX
rw-rw-rw..therefore with a umask of 022, you get rw-r--r--.
the default permission for dir is rwxrwxrwx, so you get rwxr-xr-x.
with the default permissions the way they are, it is impossible to get x on a file. perhaps there is a kernel parameter that can change this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2001 10:01 AM
04-03-2001 10:01 AM
Re: umask in HP-UX
The key is that the default permissions for files at creation are 666 (-rw-rw-rw-) whereas for directories the default is 777 (rwxrwxrwx).
Thus, using a umask of 022 gives:
-> files: 666 - 022 = 644 (-rw-r--r--)
-> directories" 777 - 022 = 755 (rwx-r-x-r-x)
Thus, for files, setting umask to 077 will yield a file with permissions of -rw------ for which you will have to use 'chmod' to make it executable.
...JRF...
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2001 10:26 AM
04-03-2001 10:26 AM
Re: umask in HP-UX
If this line was in your .profile, it would set your process umask value to 022, which means a file created later will be 644 (rw-r--r--) rather than 666 (rw-rw-rw-), or 755 (rwxr-xr-x) instead of 777 (rwxrwxrwx).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2001 11:23 AM
04-03-2001 11:23 AM
Re: umask in HP-UX
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2001 11:33 AM
04-03-2001 11:33 AM
Re: umask in HP-UX
In the past, I've created useful aliases for creating files, especially scripts. you could set up and alias that does a touch then chmod... or write a little script to do the same thing. You could also have it "vi" the file so all you have to do is type in the script name and pass it the new file name and it does all three steps for you.
HTH
Rusty Sapper