ASPL Manual v 1.00
© 2024 by SetSphere.COM


11-9

   Glob Directories on UNIX Systems

[Glob Directories on UNIX Systems]

WORKSPACE TESTGGDIR DESCRIPTION:

This is workspace is used to show how to glob directories on the UNIX systems using ASPL global grouping function ggdir() and how to compare directories, subdirectories, and files. In the following the 'aspl >' refers to the ASPL prompt, and the '#' refers to the shell prompt.

mkdir /tmp/junk
    (create the directory /tmp/junk)

createtestff.pl /tmp/junk
    (run createtestff.pl to create the directory structure)

tree /tmp/junk
    (view the directory structure in /tmp/junk)

tree -d /tmp/junk
    (view the subdirectories in the directory structure)

aspl -wsname TESTGGDIR -groupingclass POSIX
    (start ASPL loading the sample workspace TESTGGDIR)

①  aspl> egCwhoami
    (ping the grouping class)

②  aspl> ggls ggdir()
    (display the ggdir() function)

③  aspl> ggls ggdir
    (list all ggdir related functions)

④  aspl> timeout 90
    (set timeout to 90 seconds in case your system is too slow)

⑤  aspl> ks
    (print the ks vector along other related attributes information)

⑥  aspl> ks mtime chksum entropy ppdd ffl
    (set the ks vector to: mtime chksum entropy ppdd ffl)

⑦  aspl> sudir1 = ggdir(dir,/tmp/junk/dir1/subdir1.1/subdir1.2)
    (sudir1 set variable is assigned the directory /tmp/junk/dir1/subdir1.1/subdir1.2)

⑧  aspl> sudir2 = ggdir(dir,/tmp/junk/dir2/subdir2.1/subdir2.2)
    (sudir2 set variable is assigned the directory /tmp/junk/dir2/subdir2.1/subdir2.2)

⑨  aspl> tree /tmp/junk/dir1
    (print the tree representing the directory /tmp/junk/dir1)

⑩  aspl> tree /tmp/junk/dir2
    (print the tree representing the directory /tmp/junk/dir2)

⑪  aspl> sim sudir1 sudir2
    (display the similarity between sudir1 sudir2)

⑫  aspl> f& sudir1 sudir2
    (display the elements (files) intersection between sudir1 and sudir2)

⑬  aspl> g& sudir1 sudir2
    (display the elements (files) intersection between sudir1 and sudir2)

⑭  aspl> treed /tmp/junk/dir1
    (print the tree showing the subdirectories in /tmp/junk/dir1)

⑮  aspl> treed /tmp/junk/dir2
    (print the tree showing the subdirectories in /tmp/junk/dir2)

⑯  aspl> d& sudir1 sudir2
    (display the subgroups (subdirectories) intersection between sudir1 and sudir2)

⑰  aspl> dD sudir1 sudir2
    (display the subgroups (subdirectories) symmetric difference between sudir1 and sudir2)

⑱  aspl> d\ sudir1 sudir2
    (display the subgroups (subdirectories) symmetric difference between sudir1 and sudir2)

⑲  aspl> d\ sudir2 sudir1
    (display the subgroups (subdirectories) symmetric difference between sudir2 and sudir1)

⑳  aspl> dU sudir1 sudir2
    (display the subgroups (subdirectories) union between sudir1 and sudir2)

⑴  aspl> dir1 = ggdir(dir,/tmp/junk/dir1)
    (dir1 set variable is assigned the directory /tmp/junk/dir1)

⑵  aspl> dir2 = ggdir(dir,/tmp/junk/dir2)
    (dir2 set variable is assigned the directory /tmp/junk/dir2)

⑶  aspl> f& dir1 dir2
    (display the elements intersection between dir1 and dir2)

⑷  aspl> density dir1 dir2
    (display density histograms of dir and dir2)

⑸  aspl> y*& dir1 dir2
    (fuzzy match the elements and display the comparison)

This example is shown in the following terminal.

       terminal for example: Glob Directories on UNIX Systems
viewme

 -E- Display. 11.9.1   [GLOB DIRECTORIES ON UNIX SYSTEMS][Glob Directories on UNIX Systems]
Terminal showing Glob Directories on UNIX Systems