Next: , Previous: , Up: Commanding poke   [Contents][Index]

1.4.4 Command Files

Command files contain poke commands. A poke command may be a dot command, a Poke statement or a Poke expression. Lines starting with # are comments will be ignored. However a comment must start at the beginning of a line. Here is an example of a script:

# The following two lines are dot commands
.set obase 16

# The following line is a Poke statement
dump :size 0x100#B :from 0x10#B

# The following line is a Poke expression statement without any side effect.
# Consequently it is valid, but rather useless.
4 == 4

A command file contains commands, not Poke code. This means it gets read line by line and commands cannot occupy more than one line. Hence the following is a valid command file:

type foo = struct {int this; int that;}

but this is not valid as a command file (although it is a valid Poke statement) and will provoke an error:

type foo = struct
 int this;
 int that;

Command files can be loaded at startup using the -s command line option (see Invoking poke). The ~/.pokerc startup file is also an example of a poke command file (see pokerc).