The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need to create file from shell scripting smr_rashmy Shell Programming and Scripting 4 01-28-2008 10:59 PM
How do i iterate thru each line of a file in shell scripting? Ravi Varma Shell Programming and Scripting 2 09-06-2007 12:28 AM
Shell scripting adding text to top of file meadhere UNIX for Dummies Questions & Answers 7 07-05-2007 10:31 AM
.def file in HP-UX Shell scripting manu.vmr Shell Programming and Scripting 1 01-24-2007 12:17 PM
file activity (open/closed) file descriptor info using KORN shell scripting Gary Dunn UNIX for Dummies Questions & Answers 3 06-07-2004 02:54 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-02-2007
barbus barbus is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 31
file permissions using shell scripting

Hi
I am trying to use shell script to display file permissions, and I can do it fine for the current user logged in, but now I want to view all file permissions for the Owner of the file, Group users and everyone, so it will look something like this:
-----------------READ WRITE EXECUTE
OWNER Username ---YES---YES---NO
GROUP USERS ---YES---NO---NO
EVERYBODY ---NO----NO---NO

Below is what I have so far.

Code:
echo -n "please enter file name : "
read file 
[ -w $file ] && W="Write = yes" || W="Write = No"
[ -x $file ] && X="Execute = yes" || X="Execute = No" 
[ -r $file ] && R="Read = yes" || R="Read = No" 
echo "$file permissions $W $R $X"

so my question is how do I find out the other permissions of the file?.

Any hints of tips would be greatly appreciated.

thanks

Last edited by barbus; 10-02-2007 at 05:52 AM..
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:11 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0