#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
 
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2019-01-12.   This site is PIKT® powered.
Copyright © 1998-2019 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
View sample
HTML
anchor tag
macros