Out of curiosity, I am studying it. =)
I am having trouble figuring out what's wrong with this script.
if I run it, the shell gives me this error:#!/bin/bash
#This a script that identifies a user whether he/she is a normal, system,
#or a root user.
echo -n "Please enter your username: "
if sudo grep -q $username /etc/passwd
thenid=$(sudo id -u $username)else echo "Sorry, you're not a valid user!"
declare -i user_id
if [ $user_id -ge 500 ]
thenecho "$username, you are a noraml user"elif [ $user_id -eq 0 ]echo "$username, you are a root user"elseecho "$username, you are a system user"fi
Any idea what's wrong?Please enter your username: frustphil
./identify_user.sh: line 16: syntax error near unexpected token `else'
./identify_user.sh: line 16: ` else '