Pattern-Matching in If-Condition

Hey Guys,

I'm fighting with a particular pattern match today (ksh)... I need your help!

Middle in my script I read a variable A's value. This value could have three differents form:
1) the NumClicks is the number of clicks user makes during session.
2) the MeanRate is the average number of seconds between each click
3) the SDRate is the standard deviation (n-1) of the seconds between each click (my theory is individual sessions might have evenly spaced clicks -> smaller standard deviations than other sessions).

Some other variable must be read only if variable A is "x". For that I choose a if-condition without success:

if [ $A = "x" ] or if [ $A = "x" ]
if [ $A = "x" ] or if [ $A = "x" ]

My goal is to try and see if I can find un-discovered sessions by comparing file "x" to file "y" and creating new rules/conditions to find better patterns. Keep in mind my data files are too large to grok by merely looking at them; therefore, i'm using some nice commands to cut out some columns and sort stuff out. Thanks in advance guys :smiley:

not sure what you're asking here, but....

#!/bin/ksh

typeset -i a=5
typeset -i b=15

if (( a == 5 || b == 10 )); then
   echo 'match'
else
   echo 'no match'
fi

Thanks vgersh99,

Perhaps I can be more specific here. I am trying to distinguish "robot" sessions from "real user" sessions via raw access logs. After cleaning up the logs I assign an ID to each session. I then sort the rows in the log files to group all the rows for the same session together, and assign a session sequence number to each row. The results is a sequenced type url file. This file is the input to my robot detection routine, along with a few other downstream processes. Ultimately I am trying to see if I can find ANY undiscovered robot sessions from the output of these files...hence I feel pattern matching is the best fit for me here.

ok. and the question is..... ?

Do you think I have have sufficient data above to find unique patterns between bots and users or have I missed something? If so, do you have any ideas for additional rules and/or conditions? Thanks

to be honest with you..... I have no idea what the definitions for 'bots' and 'users' are - this is all too application specific. If you have sample data files/records you would be the best person to identify the consistent patterns based on your knowledge of what you're doing and the objective.

Once you do that it becomes "a simple matter of implementation".

thank you for your time :slight_smile: