#Check if script is run as root user
#! /bin/bash
echo $EUID
if [[ $EUID -eq 0 ]]
then
echo "You are root user";
else
echo "You are not root user";
fi
$ whoami
whoami will give the name of the current user
#Check if script is run as root user
#! /bin/bash
echo $EUID
if [[ $EUID -eq 0 ]]
then
echo "You are root user";
else
echo "You are not root user";
fi
$ whoami
whoami will give the name of the current user