Tyleo-Dev-ShellScripting-Ol.../SH/userisroot.sh
2024-02-18 22:29:57 +01:00

11 lines
511 B
Bash
Executable file

#!/usr/bin/env bash
if [ $USER = root ]; then # Check for USER=root
echo "You are root"
else
echo "You are not root !"
fi
# ------------------------------------------------------------------------ #
# This script say "You are not root" when the variable $USER is not "root" #
# If the script see "root" in $USER variable, it will say "You are root"-- #
# In the case of nothing is into the variable, it will say a joke.-------- #
# ------------------------------------------------------------------------ #