-w tests to see if the script is capable of writing (to) the file i.e. using the statically defined permissions on the file, not dynamically i.e. run-time determination, as required by the OP.
In reply to Re^3: How to identify a file is in readonly mode
by Bloodnok
in thread How to identify a file is in readonly mode
by srikrishnan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |