#rkeys(), #reversekeys()

DESCRIPTION
    returns the number of keys in an associative array;
    maps those keys to a string variable when used as
    'for <stringvar> in #rkeys(<array>)';
    the keys are sequenced in alphabetically reverse sorted order

    or:

    returns the number of keys in an associative array;
    maps those keys to string variable s1 when used as
    'foreach #rkeys(<stringvar>, <array>)';
    the keys are sequenced in alphabetically reverse sorted order
SYNOPSIS
    #rkeys(s)
    #reversekeys(s)

    or:

    #rkeys(s1,s2)
    #reversekeys(s1,s2)
ARGUMENTS
     s - an associative array name

    or:

    s1 - a string variable name
    s2 - an associative array name
EXAMPLES
FileSuidUnauthorized

        init
                status active
                level critical
                task "Report suspicious suid files"
                input proc "/opt/local/bin/find / ! -fstype nfs -perm +4000"

        begin   // read in list of authorized suid files for this system
                if #fopen(SUIDFILES, "=files_suid_obj", "r") != #err()
                        while #read(SUIDFILES) > 0
                                =incr(#suid[$rdlin])
                        endwhile
                        do #fclose(SUIDFILES)
                else
                        output mail "Can't open =files_suid_obj for reading!"
                        quit
                fi
#ifdef debug
                foreach #rkeys($f, #suid)
                        output $f
                endforeach
#endifdef

        rule
                if ! #defined(#suid[$inlin])
                        output mail "$inlin is an unauthorized suid file!"
                fi
SEE ALSO
    #members()
    #keys()
    #rkeys(), #sortkeys()

    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
DNS revols.conf
config file