Originally Posted by mrbutabara
not really homework. it was in our notes, but we (the class and teacher) couldn't figure it out.
You sure he/she is a linux teacher?!?
Anyway, you can either use
echo -n "Number of user login: "; who | wc -l
where the -n option prevents echo to output the trailing newline so that further output is kept on the same line, OR
echo "Number of user login: $(who | wc -l)"
as suggested by zer0x333, with the slight difference that I used the syntax $(...) to do command substitution, OR
printf "Number of user login: %s\n" $(who | wc -l)
using the printf statement. And please, reject that teacher....!!!!!