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.
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.
The current directory is . not pwd. You are trying to test for write permission to a file called pwd in the current directory.
Doh! So I am. The question still stands though -
test -w . ; echo ?
just returns "?" now
Probably found this out already, but:
echo $?
Cheers! It's been a long long day.