Hi, I am trying to store the real name of currently logged in users as a variable or in an array. I have been having troubly with this, below I have it set into a variable. But when it enters the loop to assign each to a variable it says:
Integer expression expected.
##!/bin/bash
## userprocesses #Display actual users name
who | wc -l > nousers
set -- cut -f1 nousers
numberusers=$1
usercnt=1 \# counter used in setup
pos=1 \# position in array
outcount=1 \# counter used in getname method
userout=1 \# set for output
who -q > tempA
set -- $\( cut -f "$pos" tempA\);
while [ "$usercnt" -le "$numberusers" ]
do
eval user${pos}=$1
shift
usercnt='expr usercnt + 1'
pos='expr pos + 1'