Gnuastro’s programs (introduced in previous chapters) are designed to be highly modular and thus contain lower-level operations on the data.
However, in many contexts, certain higher-level are also shared between many contexts.
For example, a sequence of calls to multiple Gnuastro programs, or a special way of running a program and treating the output.
To facilitate such higher-level data analysis, Gnuastro also installs some scripts on your system with the (
astscript-) prefix (in contrast to the other programs that only have the
Like all of Gnuastro’s source code, these scripts are also heavily commented.
They are written in portable shell scripts (command-line environments), which does not need compilation.
Therefore, if you open the installed scripts in a text editor, you can actually read them227.
For example, with this command (just replace
nano with your favorite text editor, like
$ nano $(which astscript-NAME)
Shell scripting is the same language that you use when typing on the command-line. Therefore shell scripting is much more widely known and used compared to C (the language of other Gnuastro programs). Because Gnuastro’s installed scripts do higher-level operations, customizing these scripts for a special project will be more common than the programs.
These scripts also accept options and are in many ways similar to the programs (see Common options) with some minor differences:
As a result, they do not have the following options: --checkconfig, --config, --lastconfig, --onlyversion, --printparams, --setdirconf and --setusrconf.
Gnuastro’s installed programs (those only starting with
ast) are not human-readable.
They are written in C and need to be compiled before execution.
Compilation optimizes the steps into the low-level hardware CPU instructions/language to improve efficiency.
Because compiled programs do not need an interpreter like Bash on every run, they are much faster and more independent than scripts.
To read the source code of the programs, look into the bin/progname directory of Gnuastro’s source (Downloading the source).
If you would like to read more about why C was chosen for the programs, please see Why C programming language?.