previous | next

Example angel file

ENCODING="ISO-8859-1"
TYPE=file
TITLE="dummy file to explain the angels"
TAGS="help,developer,example"
UUID="f3e24f3e-b4ee-469e-99c9-cb2335d933b9"
#PRECOMMANDS
# command section starts here 
# directory is $ANSWERDIR, quoting output of a command
ls "$OLDPWD"| head |cat -b >$ANSWERDIR/mylist
echo $(ifconfig eth0 |sed -nr 's/inet addr:([0-9\.]*).*/\1/p')  >$ANSWERDIR/IP
echo hello > $ANSWERDIR/hello
#VARIABLES
hello:bonjour
hello:gruezi
hello:tashi delek
hello:ciao
#DUMMY
@cmd:4
echo "delete /etc/passwd"
echo hahaha
echo "dummy commands are dangerous. You don't see what they're doing until you use them"@cmdend
#MAIN
This is text
this is command 1
@cmd:1
echo hello, world@cmdend

this is a multiline command
@cmd:1b
echo "hello, world"
echo "and hello, universe"@cmdend

this is the output of file mylist
{{@file:mylist}}
file 'mylist' is created in the precmd-section with redirected output

this is the content of /proc/sys/net/ipv4/ip_forward
{{@file:/proc/sys/net/ipv4/ip_forward}}

this command has a variable value
@cmd:3
echo {{hello}}@cmdend

the variable can be changed with `d` [type d on the console]

This is a dummy command: the real command is hidden
@dmd:4
I am a dummy@dmdend

this command will ask you something:
@cmd:7
 echo "the weather is: {{@?:what's the weather: dude}}" @cmdend

the same as 
@cmd:8
read -p  "what's the weather: dude" var
        echo "the weather is: $var" @cmdend

this command knows your IP without promting for it:
@cmd:9
echo "your IP: " {{@file:IP}} @cmdend
It used a a command in the precmd section and quotes it here