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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Directory Default Permissions prvnrk UNIX for Advanced & Expert Users 4 10-18-2007 09:22 PM
How Can I Easily Determine If A File Has been Added to a Directory goodmis UNIX for Advanced & Expert Users 7 02-03-2007 10:13 PM
How Can I Easily Determine If A File Has been Added to a Directory goodmis UNIX for Dummies Questions & Answers 1 01-31-2007 03:56 PM
cannot determine current directory axes UNIX for Advanced & Expert Users 15 11-13-2006 04:39 AM
permissions of a directory smehra UNIX for Dummies Questions & Answers 3 06-04-2006 07:32 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-07-2006
Registered User
 

Join Date: Feb 2006
Posts: 25
determine owner directory permissions from within the directory

From within a directory, how do I determine whether I have write permission for it.

test -w pwd ; echo ?

This doesn't work as it returns false, even though I have write permission.
Reply With Quote
Forum Sponsor
  #2  
Old 03-07-2006
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,656
The current directory is . not pwd. You are trying to test for write permission to a file called pwd in the current directory.
Reply With Quote
  #3  
Old 03-07-2006
Registered User
 

Join Date: Feb 2006
Posts: 25
Doh! So I am. The question still stands though -

test -w . ; echo ?

just returns "?" now
Reply With Quote
  #4  
Old 03-07-2006
Registered User
 

Join Date: Sep 2002
Location: San Fran
Posts: 111
Probably found this out already, but:
echo $?

Reply With Quote
  #5  
Old 03-07-2006
Registered User
 

Join Date: Feb 2006
Posts: 25
Cheers! It's been a long long day.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:45 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0