This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]