I also just realized that in my 'while loop' test to see if the user is currently logged in:
while [[ ${userid} != ${id} ]]; do
using:
set -A id $(ecs.ctl -U $euser -P $epass -C GUI_Server -M sf40ctm1 -cmdstr PGUI |grep -v The |grep -v have |grep -v Open |awk '{print $2}')
to get the userid
The while loop is only checking the first occurrence in the 'id' array field. I.e. The output would be:
365 jx5h T00A1AD.opr.statefarm.org ECS_GUI 03/13/03 08:41:49:389920
447 jx5h T0093E5.opr.statefarm.org ECS_GUI 03/17/03 18:12:23:268080
450 c8zg T000FDA.opr.statefarm.org ECS_GUI 03/18/03 07:18:17:484342
and if I try user 'jx5h' the test will pass, but if I try to use 'c8zg' the test will fail every time!
I know that the 'id' array contains all of the data, but somehow I am not reading all of that data in my 'while' test.
Main Topics
Browse All Topics





by: j8vyPosted on 2003-03-21 at 03:11:02ID: 8179983
I am sure that I need to assign the uid to an array.
I did this for the username so that I could verify if the username being entered was a valid user.
You will notice this in my code:
set -A id $(ecs.ctl -U $euser -P $epass -C GUI_Server -M sf40ctm1 -cmdstr PGUI |grep -v The |grep -v have |grep -v Open |awk '{print $2}')
I know that I can also do this for the uid,
like this:
set -A uid $(ecs.ctl -U $euser -P $epass -C GUI_Server -M sf40ctm1 -cmdstr PGUI |grep -v The |grep -v have |grep -v Open |awk '{print $1}')
but my question is, how do I relate the uid and the username if they are in seperate arrays.
Thanks again.