parm instring="@" entry="main" setvar string ups("!instring") if "!entry" = "main" echo echo ************************************************************ echo * [SHOWIPS] Command file to list selected sessions and * echo * their IP addresses. * echo ************************************************************ # * Usage : SHOWIPS xxx where xxx can be any string * # * e.g. S1234, SYS, JOHN or IP address. * # ************************************************************ # * Author : J.Dunlop Date : 09/09/98 Version : A.01 * # ************************************************************ # * Modifications :- * # * * # ************************************************************ echo ## Do MPE Command with output redirected to Temporary file ## purge tempfile,temp > $null listfile ci.pub.sys,8 > tempfile !hpfile "!string","show" < tempfile else if "!entry" = "show" ## Set n to the EOF of the redirected temporary file ## setvar n finfo(hpstdin,"eof") ## While loop to read all records from the temporary file ## ## into a buffer (buf) which can be searched using the ## ## "POS" command to identify relevant strings. ## while setvar(n,n-1)>=0 and len(setvar(buf,rtrim(input())))>=0 errclear if pos("REM :","!buf") > 0 and & (pos("!string","!buf") > 0 or "!string" = "@") ## If the "searchstring" found in "buf", do some actions ## echo !buf endif endwhile echo endif ## Do cleanup of any variables ## deletevar buf,n > $null endif