The macros in this section are special macros in that their arguments are not automatically evaluated before the macro-call but instead are evaluated by the macros themselves. Therefore it is exactly specified when the arguments to these macros are evaluated.
A few examples:
%for(i,1,10,%i%" ") => 1 2 3 4 5 6 7 8 9 10 %for(i,10,1,%i%" ") => 10 9 8 7 6 5 4 3 2 1 %for(i,1,10,2,%i%" ") => 1 3 5 7 9 %for(i,10,1,-2,%i%" ") => 10 8 6 4 2 %for(i,1,10,0,%i%" ") error--> increment in for-loop cannot be zero %for(i,10,1,1,%i%" ") =>
%list()
returns an empty list while
%list(%"")
returns a list with one element, which is the empty
string.
%encode(%split(foo::bar:rules,:+)) => %list(%"foo",%"bar",%"rules")
%join(:,%list(the,quick,brown,fox)) => the:quick:brown:fox
strcmp()
C
function. Returns the resulting list.
%encode(%uniq(%list(a,b,b,c,d,e,e,e,f))) => %list(%"a",%"b",%"c",%"d",%"e",%"f")
-1
. The
file is opened for reading if mode is omitted or is r
. The
file is opened for writing if mode is w
.
-1
if something goes wrong. Note that
the arguments are not subject to shell expansion, since the process does
not start a subshell. If you want shell expansion, you have to start a
subshell explicitly. For example, to list all files beginning with an
a
:
%pipe(/bin/sh,-c,ls a*)
uid
gid
size
blksize
blocks
atime
mtime
ctime
All times are given in seconds since January 1, 1970, 00:00:00 GMT. For
detailed description of these values see stat(2)
.
-1
. Furthermore,
sets the variables with numerical names (beginning with @math{1}) to the
contents of the corresponding submatches (parts of the regular
expression enclosed by parentheses). The variable 0
contains the
whole match. For example:
%match(%"\.([^.]*)$",alittlepicture.jpg) %1 => 14 jpg
%gsub(HEINZI Deinzi,[Ee][Ii],!) => H!NZI D!nzi
%substring(3,0123456789) => 3456789 %substring(-3,0123456789) => 789 %substring(2,3,0123456789) => 234 %substring(2,-5,0123456789) => 234
strcmp()
C function with string1
and string2.
%number(34,2) => 100010 %number(-255,16) => -ff
%void(%match(%"\.([^.]*)$",alittlepicture.jpg))%1 => jpg
chpp
does not output anything.
chpp
to give a warning with the message message.
chpp
to signal an error with the message message.
Go to the first, previous, next, last section, table of contents.