I found the following bash script which I would like to run, but I am not completely sure about what it is going to do. Can someone explain the working of the following bash script; i.e. what is it doing and how is it doing so?
echo - "Who are you looking for: "
read user
if [ -n "$user" ]
then
list=`w | grep $user | cut -c19-30`
if [ "$list" != "" ]
then
echo "The user $user is logged in from $list"
else
echo "The user $user is not logged in now"
fi
fi
echo
command in bash, or I don't know whatif
keyword do, then this make more sense and you can ask. And first to know something about a bash script, please read a tutorial.