ASPL Manual v 1.00
© 2024 by SetSphere.COM
Comparing directories and files on the UNIX system is easy with ASPL. The following chapter shows how to use ASPL scripting language to compare two directories on your UNIX system.
[Top Text]
1. #!/usr/bin/env /opt/ASPLv1.00/bin/aspl 2. #ENVARG= -groupingclass POSIX -wsname TRANSIENT -singlepass 3. 4. ;;*********************************************************************** 5. ;; dircompare.aspl 6. ;; 7. ;; This example shows the power of ASPL in doing UNIX directories 8. ;; comparison. The directories are treated as ASPL groups, and their 9. ;; their subdirectories as subgroups, and their files as elements 10. ;; 11. ;;*********************************************************************** 12. 13. endScriptIfShellArgsLessThan 2 14. 15. ;; tee -a /public/tee/dircompare.aspl.tee 16. DEF FN cmp2sets := {gU {g\, %%1 %%2}{g\, %%2 %%1}{g&, %%1 %%2}} 17. 18. timeout 60 19. displayoff 20. 21. ks chksum size ppdd ffl 22. 23. d1 = ggdir(grp1,$1,dir,$1) 24. d2 = ggdir(grp1,$2,dir,$2) 25. 26. displayon 27. ks chksum size mtime ffl 28. ;; sequencing lcs 29. g%U d1 d2 30. sim d1 d2 31. FN cmp2sets(d1,d2) 32. 33. endscript 34. 35. __END__ 36. 37. $00 compares two directories 38. 39. $00 must be followed by the names of two directories 40. 41. Example: To compare the two directories /tmp/aa3 and /tmp/aa6 42. 43. $00 /tmp/aa3 /tmp/aa6 44.
Figure dircompare.png
This example is shown in the following terminal.
display or terminal for Example: Script direcompare