or THE LANGUAGE OF ANGELS
Angelscripts have 4 sections:
1. header
2. pre-commands
3. a-variables
4. main
The sections are separated by the 3 code words starting at the beginning of the line:
#PRECOMMANDS
#VARIABLES
#MAIN
The header contains a few variables, of which 'TYPE' and 'TITLE' are mandatory. The following variables can be set:
TYPE= |
defines the type of angel, i.e. 'file' or 'directory' ('find' is a third type, but it is virtual) |
TITLE= |
the title of the angel (quoting needed) |
TAGS= |
additional tags for the search |
UUID= |
a unique identifier created with uuidgen to find the angel by reference independent of its location |
GROUP= |
a group name that groups angels together that share the same a-variables. This allows to set an a-variable in one angel and use it in another angel as well. |
ENCODING= |
text encoding, not implemented |
This section is executed before the file is displayed. Any command
can be placed here and its output redirected to a file. The file
can then be quoted inside the angel with the @file-statement or the
@include-statement.
It is useful to set parameters that a command
can find like current user ID, IP address, etc. It is also useful to
create possible options for a-variables.
angelscript code:
#PRECOMMANDS ls $HOME| wc -l > $ANSWERDIR/wc.count.txt .... #MAIN You have {{@file:wc.count.txt}} files in your home directory |
...will produce (without colours):
... |
The commands that are executed in pre-command section are sourced (!); all variables used in the script are available ($ANSWERDIR, see later).
This is the a-variable section for possible values for an a-variable: If an a-variable is changed with the command 'd', a list with possible values is presented to the user for convenience. The format is :
<varname>:<value> <varname>:<value2> <varname2>:<value> |
If you have the same values for different variables, it is more convenient to echo it to $VARDLOCAL.
This section is displayed on the screen. A line starting with '@cmd:' starts a angel-command (see later). The following codes can be used for colours/attributes:
<red>
<green>
<yellow>
<blue>
<magenta>
<cyan>
<white>
<normal>
<bold>,
</bold>
<italics>, </italics>
<ul>,
</ul>
<inv>, </inv>