#!/bin/bash

echo "write" >  test.txt

chmod -w test.txt
ls -l test.txt
if [ -w test.txt ]; then
  echo "WRITE OK"
else
  echo "WRITE NG"
fi

chmod +w test.txt
ls -l test.txt
if [ -w test.txt ]; then
  echo "WRITE OK"
else
  echo "WRITE NG"
fi

rm test.txt
