I'm trying to save the information printed out of the terminal as a variable. For example if I want to put in whoami and save it as MSG:
whoami
echo "You are currently logged in as $MSG"
I can't seem to find anything that dose work to save the impute as a variable, most things like using ret=$? returns a value of 0.
The two commands I'm trying to take the imput form are:
whoami
cat /etc/passwd | grep "/home" |cut -d: -f1
-Thank You