Skip to content

Instantly share code, notes, and snippets.

@UtsuhoRocks
Created March 27, 2025 19:35
Show Gist options
  • Save UtsuhoRocks/8bfa444b8164abdb280b7a5258ad7b7c to your computer and use it in GitHub Desktop.
Save UtsuhoRocks/8bfa444b8164abdb280b7a5258ad7b7c to your computer and use it in GitHub Desktop.
#!/bin/bash
if [ -r $1 ]
then
if [ -w $1 ]
then
if [ -x $1 ]
then
if [ -f $1 ]
then
if [ -d $1 ]
then
if [ -s $1 ]
then
if [ -e $1 ]
then
if [ -c $1 ]
then
if [ -b $1 ]
then
if [ -p $1 ]
then
if [ -h $1 ]
then
if [ -L $1 ]
then
if [ -S $1 ]
then
if [ -g $1 ]
then
if [ -u $1 ]
then
if [ -k $1 ]
then
if [ -t $1 ]
then
if [ -T $1 ]
then
if [ -N $1 ]
then
if [ -O $1 ]
then
if [ -G $1 ]
then
echo "All permissions are granted"
else
echo "Group does not have read permission"
fi
else
echo "Owner does not have read permission"
fi
else
echo "File is not modified"
fi
else
echo "File is not a text file"
fi
else
echo "File is not a terminal"
fi
else
echo "File is not sticky"
fi
else
echo "File is not setuid"
fi
else
echo "File is not setgid"
fi
else
echo "File is not socket"
fi
else
echo "File is not symbolic link"
fi
else
echo "File is not hard link"
fi
else
echo "File is not named pipe"
fi
else
echo "File is not block special"
fi
else
echo "File is not character special"
fi
else
echo "File does not exist"
fi
else
echo "File is empty"
fi
else
echo "File is not a directory"
fi
else
echo "File is not a regular file"
fi
else
echo "File is not executable"
fi
else
echo "File is not writable"
fi
else
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment