#!/bin/bash
if [ -d /root/shell ];
then
touch /root/shell/out.txt
echo "test">>out.txt
else
echo "nothing is anything!"
fi
if [ -f /root/shell/out.txt ]
then
echo "out.txt is there">>out.txt
fi
PATHNAME=/root/shell/if.sh
if [ -u $PATHNAME ]
then
echo "$PATHNAME is has a root UID"
else
echo "$PATHNAME is has not a root UID"
fi
if [ -g $PATHNAME ]
then
echo "$PATHNAME is has a root GID"
else
echo "$PATHNAME is has not a root GID"
fi
if [ -g $PATHNAME -a -u $PATHNAME ]
then
echo "$PATHNAME is has a root GID and UID"
else
echo "$PATHNAME is has not a root GID or UID"
fi
if [ -g $PATHNAME -o -u $PATHNAME ]
then
echo "$PATHNAME is has a root GID or UID"
else
echo "$PATHNAME are has not a root GID or UID"
fi
if [ -z $PS3 ]
then
echo "PS3 is null"
else
echo "PS3 is $PS3"
fi
if [ -O $PATHNAME ]
then
echo "the owner is root"
else
echo "the FILE owner is not root"
fi
|