#system()
DESCRIPTION
executes a command string, returning its exit value
SYNOPSIS
#system(s)
ARGUMENTS
s - a quoted string, or string expression, representing a command
EXAMPLES
# pikt +C 'output $text(#system("/usr/bin/true"))'
0
# pikt +C 'output $text(#system("/usr/bin/false"))'
1
if #system("=grep $user =orphans") == 0 // 0 is found
if #bypass_orphans
leave
// else proceed to check orphan status
endif
endif
rule
if #system("=egrep '^$pr1\[[:space:]]'
=objdir/ProcessesAcme.obj")
#ifdef debug
output mail "new: $pr1"
#elsedef
output mail "$pr1"
#endifdef
endif
rule // if past deadline, send out final warning and truncate,
if #timenow > %timelimit - 5*60 // 5 min fudge factor
if #system("=mailtrunc -s $text(#quota - 1000000)
=maildir $name") == 0
=execwait "=mailwarn2 =mail
=pikthostname $name $text(#size) $text(#quota)"
=outputmail "truncated $name's mail file"
output piktlog "truncated $name's mail file"
set #timelimit = 0
set #daysover = 0
next
// if not past deadline, or if truncation fails, the final
// rule about possible adiditonal warning messages applies
else
output mail "ERROR: failed to truncate $name's mail file
(look in log file for reason)"
endif
endif
SEE ALSO
$command()
Numerical Functions
String Functions