Bash: <test -w file> = true for a read-only file !!!

Joseph Banta joe_banta@perceptics.com
Fri Oct 9 11:14:00 GMT 1998


Laurent Ricci (lri@wag.ch) wrote:
> If I perform the following statement on a read-only file MyReadOnlyFile, the result is !!!
> if [-w MyReadOnlyFile ] 
> then 
> 	echo "Is writable"
> else
> 	echo "Is readonly"
> fi

I have noticed this too, and that 'sh' and 'bash' will often return different results from
the same test. I guess the answer is to get the best copy of sh / bash from one of the
primary hackers here and use it as both sh and bash.
Anyone have a better answer?
Joseph Banta
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


More information about the Cygwin mailing list

AltStyle によって変換されたページ (->オリジナル) /