Why does this script give error?
#!/bin/bash
# This script checks whether
# the current user is root or
# not.
if [ $UID -ne 0 ] then
echo "Non-root user."
else
echo "Root user."
Fi
Output
myuser@kali:~$ ./user.sh
./user.sh: line 7: syntax error near unexpected token `else'
./user.sh: line 7: `else'
myuser@kali:~$