Sponsored Content
Top Forums Shell Programming and Scripting perl script to check read/write/execute permission for 'others' Post 302690393 by itkamaraj on Thursday 23rd of August 2012 02:49:07 AM
Old 08-23-2012
you can check with stat

Code:
 
perldoc -f stat

stat - perldoc.perl.org
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Default read/write/execute permissions

I am perplexed that my script execution is not always consistent in creating new files. Specifically, my group read/write/execute permissions. For instance, take a look at the following: -rw-rw---- 1 jg dp 18648 Aug 22 10:06 nx081508.txt -rw-rw---- 1 jg dp 22422 Aug 22 10:06... (1 Reply)
Discussion started by: joeyg
1 Replies

2. UNIX for Advanced & Expert Users

Script without read permission but execute the script

I have a script, except me no one can read the script but they can execute the script. Is it possible? (14 Replies)
Discussion started by: kingganesh04
14 Replies

3. Shell Programming and Scripting

Find all files with group read OR group write OR user write permission

I need to find all the files that have group Read or Write permission or files that have user write permission. This is what I have so far: find . -exec ls -l {} \; | awk '/-...rw..w./ {print $1 " " $3 " " $4 " " $9}' It shows me all files where group read = true, group write = true... (5 Replies)
Discussion started by: shunter63
5 Replies

4. UNIX for Dummies Questions & Answers

About read,write & execute permissons of a directory

Hi all, I want to know differences between read,write & execute permissons given to directory. Thanx in advance. (6 Replies)
Discussion started by: vishwasrao
6 Replies

5. Ubuntu

how to make others have read/write permission when the aotu mounted usb flash disk pluge in ?

hi all: as we know , when usb flash disk plug in and aotu mounted , the default permission of the usb flash disk is 700. that means others have no permission . the question: how to make others have read/write permission when the aotu mounted usb flash disk pluge in ? thanks !! (0 Replies)
Discussion started by: arnold.king
0 Replies

6. Shell Programming and Scripting

Need a perl script to read and write the data

Hi, I have on Designdocument in that information is stored with in tabular format.I need Perlscript to read and write the datausing perl script? Regards, Ravi (0 Replies)
Discussion started by: toravi.pentaho
0 Replies

7. Shell Programming and Scripting

Need a UNIX/perl script to read and write the data

Hi, I have on Designdocument in that information is stored with in tabular format.I need Perl/unix script to read and write the data using perl script? Regards, Ravi (4 Replies)
Discussion started by: toravi.pentaho
4 Replies

8. UNIX for Advanced & Expert Users

Allow user without dir write permission to execute a script that creates files

In our project we have several unix scripts that trigger different processes. These scripts write logs to a particular folder 'sesslogs', create output data files in a separate directory called 'datafiles' etc. Usually L1 support team re-run these scripts . We donot want L1 support team to have... (14 Replies)
Discussion started by: waavman
14 Replies

9. Shell Programming and Scripting

Find list of files missing read & execute permission

Hi, I'm writing a post-upgrade script and I want to find which files don't have read and execute to everyone. I can run a find . ! -perm, but then I have to use a list of the possible permissions (777,775, 755 etc). Is there a more elegant solution? Thanks (2 Replies)
Discussion started by: Catullus
2 Replies

10. UNIX for Beginners Questions & Answers

Checking if the directory has read and write permission

logMsg='Started by '${USER} LOG_MESSAGE "${logMsg}" resultCode=$? if ]; then return ${resultCode} fi touch ${FILELISTPATH} resultCode=$? if ]; then logMsg='failed to create file list:'${FILELISTPATH} LOG_ERROR "${logMsg}" CUSTOM_PREPROCESS ${FATAL} ... (2 Replies)
Discussion started by: raka123
2 Replies
access(2)							System Calls Manual							 access(2)

NAME
access() - determine accessibility of a file SYNOPSIS
DESCRIPTION
The system call checks the file pointed to by path for accessibility according to the bit pattern contained in amode. uses the real user ID, not the effective user ID, and the real group ID, not the effective group ID. The value of amode is either the bit-wise inclusive OR of the access permissions to be checked, or the existence test. You can use the following symbolic constants, defined in to test for permissions: Read access Write access Execute (search) access Check existence of file The owner of a file has permission checked with respect to the "user" read, write, and execute mode bits. Members of the file's group other than the owner have permissions checked with respect to the "group" mode bits. All others have permissions checked with respect to the "other" mode bits. If a file is currently open for execution, reports that it is not writable, regardless of the setting of its mode. Access Control Lists - HFS File Systems Only Read, write, and execute/search permissions are checked against the file's access control list (ACL). Each mode is checked separately since different ACL entries can grant different permissions. The real user ID is combined with the process's real group ID and each group in its supplementary groups list, and the access control list is searched for a match. Search proceeds in order of specificity and ends when one or more matching entries are found at a specific level. More than one or entry can match a user if that user has a nonnull sup- plementary groups list. If any matching entry has the appropriate permission bit set, access is permitted. Access Control Lists - JFS File Systems Only Read, write, and execute/search permissions are checked against the file's access control list (ACL). The real user ID is combined with the process's real group ID and each group in its supplementary groups list, and the access control list is searched for a match. Search proceeds in order of ACL entries and ends when the first entry matching the user ID or any of the group IDs is encountered. If a shared text file is currently open for execution, reports that it is not writable, regardless of its access control list. However, does not report that a shared text file open for writing is not executable, since the check is not easily done. It also reports that a file on a read-only file system is not writable. Security Restrictions If the path is valid and the real user ID is superuser or a user with and privileges, always returns except when amode includes the path is not a directory, and none of the execute bits are set in the file's mode. See privileges(5) for more information about privileged access on systems that support fine-grained privileges. RETURN VALUE
returns the following values: Successful completion. The requested access is permitted. Failure. is set to indicate the error. ERRORS
If fails, is set to one of the following values. Search permission is denied on a component of the path prefix. The access control list does not permit the requested access and the real user ID is not a user with or privileges. path points outside the allocated address space for the process. The reliable detection of this error is implementation dependent. Too many symbolic links were encountered in translating the path name. The length of the specified path name exceeds bytes, or the length of a component of the path name exceeds bytes while is in effect. Read, write, or execute (search) permission is requested for a null path name. The named file does not exist. A component of the path prefix is not a directory. Write access is requested for a file on a read-only file system. Write access is requested for a pure procedure (shared text) file that is being executed. SEE ALSO
acl(2), chmod(2), stat(2), setacl(2), acl(5), aclv(5), privileges(5), unistd(5). STANDARDS CONFORMANCE
access(2)
All times are GMT -4. The time now is 10:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy