08-23-2012
perl script to check read/write/execute permission for 'others'
I want to check access rights permissions not for 'user', not for 'group', but for 'others'.
I want to do it by system command in which i want to use 'ls -l' and 'awk' command.
I have written the following program :
PHP Code:
#!/usr/bin/local/perl
#include <stdlib.h>
system ("ls -l | awk '/^-......r../ {print $9 " is readable for others}' ");
system ("ls -l | awk '/^-.......w./ {print $9 " is writable for others}' ");
system ("ls -l | awk '/^-........x/ {print $9 " is executable for others}'");
I have tried most of the system command syntax, google can give.. have also tried with open and exec.. but all efforts in vain
grateful if you help..
Moderator's Comments:
|
|
Please use code tags next time for your code and data.
|
|
Moderator's Comments:
|
|
Double post. Closed.
|
|
Last edited by Scott; 08-23-2012 at 04:52 AM..
Reason: zaxxon: code tags; Scott: closed
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
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
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
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
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
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
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
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
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
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
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