ASPL User Manual v 1.00
© 2025 SetSphere.com
The ASPL interpreter provides a scripting language and it can parse, analyze, and execute ASPL scripts. However, how to get the shell to load the interpeter so that the later can execute the content of the script.
The env command is used on many systems to startup a computer script. The script name, an exceutable file also called program, follows the env command and the system initializes the system environment and exec the corresponding script.
The scripting language of an interpreter typically provides a mechanism to load a script through the environment of the UNIX system. This is typically done in two ways: either by invoking the interpreter following #! and these two characters happen to be the absolute first two characters in the content of the script name, or by invoking the env directly: that is by including env on the first line and by following it by the interpreter name.
In either case the script is loaded through the UNIX shell environment. The first case requires specifying the full path to the location of the interpreter, and may not work on some UNIX systems where the loading of the special (hashclamation) shebang #! has been disabled. The second case may seem simple, yet we need to give it special attention considering the many UNIX systems and the fact that env loading mechanism has not been addressed by POSIX (different vendors implement the env following their needs). Furthermore some vendors provide the -S option supposedly to be followed by a string to be split into the script name and its argument, but fail the split and present the whole string as it is: one long string that is assumed to be the interpreter name (hence failing once again if the string contain arguments). In addition, the location of the env command may vary between systems: the env program may be located in /usr/bin, or /bin, or somewhere else.
Since all UNIX vendors (at least) load what follows the env as a single string pointing to the interpreter named program, then it is possible to generalize a solution to the loading of the interpreter and its arguments.
To overcome the env loading issues, and to make ASPL portable on different
UNIX systems, ASPL uses a two-lines shebangs initiator: the first line is to read
the interpreter name, and the second line is to pass the arguments of the program.
Note that the script name is the program name itself and is implicitly passed
by env as $0 shell variable.
UNIX systems, ASPL uses a two-lines shebangs initiator: the first line is to read
the interpreter name, and the second line is to pass the arguments of the program.
Note that the script name is the program name itself and is implicitly passed
by env as $0 shell variable.
This chapter shows some scripting examples that can be run by the ASPL interpreter. All scripts can be found in the shared folder where you have installed the ASPL interpreter.
■ List of Scripts
The following is a list of the scripts in this chapter:
dircompare.aspl
Compare Two Directories: dircompare.aspl see SECTION 12.2.1 [Compare Two Directories: dircompare.aspl]
dirdiff.pl
Diff Directories on UNIX hosts: dirdiff.pl see SECTION 12.3.1 [Diff Directories on UNIX hosts: dirdiff.pl]
Realtime Monitoring of System Directories
Realtime Monitoring of System Directories see SECTION 12.4.1 [Realtime Monitoring of System Directories]
randomdice.aspl
Throwing Dice Simulation: randomdice.aspl see SECTION 12.5.1 [Throwing Dice Simulation: randomdice.aspl]
mutant.aspl
Mutant DNA Alignment: mutant.aspl see SECTION 12.6.1 [Mutant DNA Alignment: mutant.aspl]
twospheres.aspl
Intersecting Two Spheres: twospheres.aspl see SECTION 12.7.1 [Intersecting Two Spheres: twospheres.aspl]
polyclouds.aspl
Random Polygons on Three Spheres: polyclouds.aspl see SECTION 12.8.1 [Random Polygons on Three Spheres: polyclouds.aspl]
jarcompare.aspl
Comparing Two Jar Files: jarcompare.aspl see SECTION 12.9.1 [Comparing Two Jar Files: jarcompare.aspl]
jarcompare.pl
Comparing Jar Files: jarcompare.pl see SECTION 12.10.1 [Comparing Jar Files: jarcompare.pl]
jarcomparelong.aspl
Extended Comparison of Jar Files: jarcomparelong.aspl see SECTION 12.11.1 [Extended Comparison of Jar Files: jarcomparelong.aspl]
jarsimilarity.pl
Similarity Between Jar Archive Files: jarsimilarity.pl see SECTION 12.12.1 [Similarity Between Jar Archive Files: jarsimilarity.pl]
pathcompare.pl
Compare System PATHs: pathcompare.pl see SECTION 12.13.1 [Compare System PATHs: pathcompare.pl]
pathcompare.aspl
Compare Two System PATHs: pathcompare.aspl see SECTION 12.14.1 [Compare Two System PATHs: pathcompare.aspl]
envcompare.pl
Compare System Environment Variables: envcompare.pl see SECTION 12.15.1 [Compare System Environment Variables: envcompare.pl]
progenv.aspl
Environment Variables in a Shell: progenv.aspl see SECTION 12.16.1 [Environment Variables in a Shell: progenv.aspl]
progenvcompare.aspl
Compare Program Env. Variables: progenvcompare.aspl see SECTION 12.17.1 [Compare Program Env. Variables: progenvcompare.aspl]
progenvshellscompare.aspl
Comparing Shell Variables: progenvshellscompare.aspl see SECTION 12.18.1 [Comparing Shell Variables: progenvshellscompare.aspl]
progenvshellsmerged.aspl
Merging Shell Variables: progenvshellsmerged.aspl see SECTION 12.19.1 [Merging Shell Variables: progenvshellsmerged.aspl]
reapenv.aspl
Reaping the environment of a process: reapenv.aspl see SECTION 12.20.1 [Reaping the environment of a process: reapenv.aspl]
reapenvcompare.aspl
Compare Reaped Environment: reapenvcompare.aspl see SECTION 12.21.1 [Compare Reaped Environment: reapenvcompare.aspl]
reapenvpidcompare.aspl
Compare Thread Environments: reapenvpidcompare.aspl see SECTION 12.22.1 [Compare Thread Environments: reapenvpidcompare.aspl]
wasreaper.aspl
Reaping WebSphere JVM Processes: wasreaper.aspl see SECTION 12.23.1 [Reaping WebSphere JVM Processes: wasreaper.aspl]
■ Executing ASPL from other programming languages
Since it is possible to pipe STDIN to the ASPL interpreter then one can use ASPL with other programming languages. ASPL reads the STDIN first line and determines if it is a shebang giving priority to its arguments (overriding any argument should it be specified prior to the -STDIN pipe). The following scripts show how to call ASPL from PERL scripts. We will consider three examples:
script name description --------------- ------------------------------------------------------- pathcompare.pl compares your PATH on different hosts envcompare.pl compares your ENV on different hosts jarcompare.pl compares the similarities between multiple JAR archives
● Script pathcompare.pl
Compare System PATHs: pathcompare.pl see SECTION 12.13.1 [Compare System PATHs: pathcompare.pl] Use the Perl script pathcompare.pl to compare your PATH on different hosts in a cloud environment. This script can retrieve and turn the list of files found on remote host PATH into a dataset. You will use ASPL to compare the PATH of many hosts in a cloud environment.
● Script envcompare.pl
Compare System Environment Variables: envcompare.pl see SECTION 12.15.1 [Compare System Environment Variables: envcompare.pl] Use the Perl script envcompare.pl to compare the ENV on different hosts in a cloud environment. This script can retrieve and turn the list of environment variables on remote hosts into datasets. With ASPL you can compare the ENV of many hosts in a cloud environment.
● Script jarcompare.pl
Comparing Jar Files: jarcompare.pl see SECTION 12.10.1 [Comparing Jar Files: jarcompare.pl] Use the Perl script jarcompare.pl to compare the content of JAR archive files. Classes or JAVA files that have the same names can be compared since ASPL comparison algorithm work on the element attributes (like the checksum attribute). ASPL set operators can display changes in JAR archives by treating and comparing their content as datasets.