On Saturday, September 20, 2003, at 07:18 PM, Jakob Peterh�nsel wrote:

Using multiple matches in one GREP does not work, like:
        mtch m"(#).(##)"
Only ${1} is filled with data here.

I'm not sure what is going wrong. ${2} should also be filled in. Please make sure you immediately storing the valueof ${1} or ${2} into a variable of another name. If you perform another regexp match, the values of ${1} and ${2} will be overwritten. In my tests, the multiple matches in one GREP are working.


Also, "\s" for finding SPACE does not work. A . (wildcard char) does work, though.

You are right about "\s". The "\" is being ignored when the initial string is tokenized; you will need escape the "\", ie. specify "\s" as "\\s". In the future, string arguments marked as regular expressions with "m" probably should leave the \ escapes alone.


There were a couple of typos in my previous response. The following should work, I believe, although I haven't tested it (note the +3):

MTCH m"version\\s(#+\.#+)\#uptime\\s(#+\\sdays,\\s##:##:##)"i else #+3
STOR "Version" "${1}"
STOR "Uptime" "${2}"

While on the subject, initiating the var and then not finding it in the TCP script, makes the var NOT FOUND.

Doing this:
STOR "Uptime" "n/a"
CONN #60
...
MTCH m"###.###"i else goto #+2
STOR "Uptime" "${1}"

The above code will display the VAR Uptime as "n/a" or the value found, if the script is able to connect to the remote server.
If it is NOT able to connect (like, if you unplug the ethernet cable..) the variable will show as "NOT FOUND: Uptime"

If the probe is unable to connect, it doesn't execute any commands in the script. This is why the "Uptime" variable says it isn't found; the STOR command was never executed.


Could we get a 'fix' for this? I would like to be able to determine whet should be displayed here.

It might be possible to fix it so any initial STOR commands (up to the first CONN command) are always executed, regardless of whether the connection fails.


Regards,

Bill Fisher
Dartware, LLC
http://www.dartware.com

____________________________________________________________________
List archives: http://www.mail-archive.com/intermapper-talk%40list.dartware.com/
To unsubscribe: send email to: [EMAIL PROTECTED]

Reply via email to