May 12, 2011

superuser

Forums: 

Hi, I am new.

I have a simple question.

On Ubuntu, I made a script:

#!/bin/bash

if [ "$(id -u)" = "0" ]; then
echo "superuser"

else
echo "no"
fi

I called the file "boo".

When I run "boo" as a regular user it says "no". But when I sudo su it, it says "boo" is not a command. So, how do I make it output "superuser".

Hope this make sense.