Testing for write permission is done by rc write redirection (echo >.tmp). If it fails then commands intended for such condition will not be executed. Use touch(1) for that test instead.
Reference: /n/sources/patch/patchapply-write-perm
Date: Wed Mar 4 02:29:10 CET 2015
Signed-off-by:
an...@ml.lv
--- /rc/bin/patch/apply Wed Mar 4 02:26:01 2015
+++ /rc/bin/patch/apply Wed Mar 4 02:25:58 2015
@@ -23,7 +23,7 @@
exit badpatch
}
-if(! echo >.tmp || ! rm .tmp){
+if(! touch .tmp || ! rm .tmp){
echo no write permission >[1=2]
exit 'no write permission'
}