#length()

DESCRIPTION
    returns the length (number of characters) in a string
SYNOPSIS
    #length(s)
ARGUMENTS
    s - a string, or string expression
EXAMPLES
        rule
                if #length($password) == 0
                        output mail "User $username has no password!"
                endif
        rule    // magic cookie?
                if    #nis
                   && #length($username) == 1
#if ! webapp
                        output mail "Illegal magic cookie line: $inline"
#endif
                        next
                endif
#if sunos // | linux
        rule    // passwd wrong length
                if    ! #nis
                   && #length($password) != 13
                   && $password ne ""           // empty password reported in
                                                // PasswordFileProblemsUrgent
                   && $password ne "*"
                        output mail "User $uname's password $password not prescribed 13 chars"
                endif
#endif
        rule
#if adminsys
                if    #true()           // all users, on admin systems
#else
                if    $user eq "root"   // root only, on user systems
#endif
#if solaris | sunos
                   && (    #length($idle) == 0
                        || $idle =~ "^[0-9]+$"  // idle time in minutes,
                                                // not hours or days
                      )
#elif linux
                   && (    $idle =~ "^[[:digit:]]+\\.[[:digit:]]+s$"
                        || $idle =~ "^[[:digit:]]+:[[:digit:]]$"
                      )
#endif
                        output log "=afterhoursuseractivity_log" $inline
                        // output mail $inline
                        // output print $inline
                endif
SEE ALSO
    #inlen(), #inputlength()

    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
Learn about
Pikt script
string
functions