ASPL Manual v 1.00
© 2024 by SetSphere.COM


12-20

   Script reapenvpidcompare.aspl

Reap the environment of many threads started on the UNIX system. These threads can be started by a single program, as is the case with the JEE application, IBM WebSphere Application Server, starting many JVM as UNIX threads. The scripts collects the environment variables and compares them using ASPL set operators.

       [Top Text]

 -L- Listing. 12.20.1   [LISTING reapenvpidcompare.aspl][ASPL Script reapenvpidcompare.aspl]
(raw text)
1.     #!/usr/bin/env aspl
2.     #ENVARG= -groupingclass SYSENVGROUP -wsname TRANSIENT -singlepass 
3.     
4.     ;;***********************************************************************
5.     ;;
6.     ;;   reapenvpidcompare.aspl
7.     ;;   Reap two programs processes and gather their environment variables
8.     ;;   then compare these variables as grouped per process number, and show
9.     ;;   how they differ.
10.    ;;   Copyright © 2024 Bassem W. Jamaleddine
11.    ;;
12.    ;;***********************************************************************
13.    
14.    endScriptIfShellArgsLessThan 2  ;; make sure at least two arguments passed
15.    
16.    ks varname varvalue chksum ppdd ffl
17.    displayoff
18.    printblock *** REAPING ENV OF $1 ***
19.    e1 = ggreapenvbypid(program,$1,onlychanged,1)
20.    printblock *** REAPING ENV OF $2 ***
21.    e2 = ggreapenvbypid(program,$2,onlychanged,1)
22.    displayon
23.    
24.    printblock *** COMPARING REAPED PROCESSES ENVIRONMENT VARIABLES ***
25.    ,f& e1 e2
26.    printblock *** IN 1st NOT IN 2nd ENVIRONMENT VARIABLES ***
27.    ,f\ e1 e2
28.    printblock *** IN 2nd NOT IN 1st ENVIRONMENT VARIABLES ***
29.    ,f\ e2 e1
30.    
31.    printblock *** MATCHING REAPED ENVIRONMENT VARIABLES ***
32.    ,f&`ks= e1 e2
33.    printblock *** DIFFERED REAPED ENVIRONMENT VARIABLES ***
34.    ,f&`ks~ e1 e2
35.    printblock *** SIMILARITY COMPARISON ***
36.    sim e1 e2
37.    dm 3
38.    v
39.    
40.    endscript
41.    
42.    __END__
43.    
44.      $00 command harvest the environment variables of two programs
45.    
46.        $00 must be followed the fully specified pathes of two programs
47.    
48.      Examples:
49.    
50.        $00 "/opt/IBM/WebSphere/AppServer/bin/startServer.sh server1" 
      /opt/IBM/WebSphere/AppServer/bin/startNode.sh 
51.        $00 /opt/IBM/WebSphere/AppServer/bin/startNode.sh  
      /opt/IBM/WebSphere/AppServer/bin/stopNode.sh 
52.    

ASPL(C) 2024 Bassem Jamaleddine




This example is shown in the following terminal.

       display or terminal for Example: Script reapenvpidcompare.aspl
viewme

 -E- Display. 12.20.1   [Script reapenvpidcompare.aspl][Script reapenvpidcompare.aspl]
run for reapenvpidcompare-aspl-links






       display or terminal for Example: Script reapenvpidcompare.aspl
viewme

 -E- Display. 12.20.2   [TERMINAL reapenvpidcompare-aspl-ex2][TERMINAL reapenvpidcompare-aspl-ex2]
run for reapenvpidcompare-aspl-ex2-links