# Shell scripting

**URL:** https://forum.kirupa.com/t/shell-scripting/294748
**Category:** Uncategorized
**Created:** [August 19, 2009, 11:03am UTC](https://forum.kirupa.com/t/shell-scripting/294748 "2009-08-19T11:03:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DemonixX](https://avatars.discourse-cdn.com/v4/letter/d/e79b87/32.png) [@DemonixX](https://forum.kirupa.com/u/DemonixX)
#### Post date: [August 19, 2009, 11:03am UTC](https://forum.kirupa.com/t/shell-scripting/294748/1 "2009-08-19T11:03:46Z")

</div>

[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]
