![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| help need for pattern matching | HIMANI | UNIX for Dummies Questions & Answers | 10 | 01-22-2008 04:30 AM |
| pattern matching in an if-then | lumix | Shell Programming and Scripting | 4 | 12-14-2007 01:25 PM |
| pattern-matching in if-condition | nymus7 | Shell Programming and Scripting | 6 | 07-19-2006 12:02 PM |
| Pattern matching sed | leemjesse | Shell Programming and Scripting | 3 | 03-23-2005 01:06 AM |
| Pattern Matching | danhodges99 | UNIX for Dummies Questions & Answers | 2 | 02-27-2003 12:03 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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: Code:
if [ $A = "x" ] or if [ $A = "x" ] if [ $A = "x" ] or if [ $A = "x" ] |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
not sure what you're asking here, but....
Code:
#!/bin/ksh typeset -i a=5 typeset -i b=15 if (( a == 5 || b == 10 )); then echo 'match' else echo 'no match' fi |
|
#3
|
|||
|
|||
|
Quote:
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. |
|
#4
|
||||
|
||||
|
ok. and the question is..... ?
|
|
#5
|
|||
|
|||
|
Quote:
|
|
#6
|
||||
|
||||
|
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". |
|
#7
|
|||
|
|||
|
Quote:
|
|||
| Google The UNIX and Linux Forums |