Getting rid of whitespace

Hello I am working aon script, that tells me how many users or on the system when i run it.

The script is

#!/bin/bash
w | cut -f 1 -d ' ' |sort -u | wc -l

When ran it shows 16 users including myself and a line of white space.

I was wondering what I need to add to remove my user name and the whitespace line from the result. Or even a good point to wich command I can use the man command to to help me out .

thanks:)

Don't forget to use code tags.

w |awk -v u=$LOGNAME 'NR>2&&$1!=u '|sort -u|wc -l

all in one:

w |awk -v u=$LOGNAME 'NR>2&&$1!=u&&!a[$1] {a[$1];t++} END {print t}'

Seems my awk don't support length(array).

(In solaris, replace awk by nawk or /usr/xpg4/bin/awk)

$ w | ruby -ane 'BEGIN{a=[]};$.>2 and a<<$F[0];END{p a.uniq.delete_if{|m| m=="myid"}.size}'
0