samedi 1 août 2020

Checking Write Permissions of file in Bash Script

#!/bin/bash
read file_name
if [ -w $file_name ]
then
    echo yes
else
    echo no
fi

This code printing yes even when file doesn't have write permission

Aucun commentaire:

Enregistrer un commentaire