|
Thank you for you reply, but i just cant get it to work, sudo is out of the question as
there is no sudo set up
if i run below as root it prints hello, but if i run as non root it will ask for password then, nothing, what am i doing wrong plse,
#!/bin/bash
if [ $(whoami) = "root" ]
then
echo "hello"
else
su root -c echo "hello"
fi
|