[COLOR=black]Was wondering if someone could help me out. I get this error message each time I try to execute the code underneath.
/home/demon/some.sh: line 8: [: too many arguments
Script contents:
#!/bin/bash
SOME=whoami
echo $SOME
USER=w -h |awk '{ print $1 }' |sort |wc
if [ $USER = 5 ]; then
grep $SOME
fi
What I want to do is:
That the script stores the output of the whoami command in a
variable. Then, if the number of users logged into the system (not
unique) is equal to 5, it should grep /etc/passwd for
the contents of the variable I created above.
Any help thxz. Yeah you can post a complete new code don’t mind.
[/COLOR]