ASPL User Manual v 1.00
© 2025 SetSphere.com


12-21

   Compare Reaped Environment: reapenvcompare.aspl

The script reapenvcompare.aspl reaps the environment variables of two programs on the UNIX system. Here we show how to reap WebSphere startNode.sh and stopNode.sh to compare their environment variables.

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

ASPL© 2025 Bassem Jamaleddine


full view

Image File

 -FG- Fig. 12.21.1   [Comparing Environment Variables Between startNode.sh and stopNode.sh]
ASPL © 2025 Bassem Jamaleddine


The run of the script reapenvcompare.aspl of reaping the startNode.sh and stopNode.sh is shown in the following terminal.
viewme

 -TC- Display. 12.21.1   [Compare Programs Environment: reapenvcompare.aspl]
run for reapenvcompare-aspl-StartStopNode-links