$basename()
DESCRIPTION
returns a filepath's terminating filename, without any directory portion
SYNOPSIS
$basename(s)
ARGUMENTS
s - a quoted string, or string expression, representing a filepath
EXAMPLES
# pikt +C 'output $basename("/usr/local/bin/snmpget")'
snmpget
init
...
input proc "=find /usr/local/share/man"
dat $filepath 1
rule
set $file = $basename($filepath)
PiktFileProblemsWarning
init
status active
level warning
task "Report file deviations on normally static PIKT files"
input proc "=cat =filespiktetc_obj"
dat $name 1
rule
set $basnam = $basename($name)
...
rule // if changed, and if we have backup of the previous file
// diff the current against the previous
if #changed
if -e "=hstdir/$basnam"
output mail "=diff =hstdir/$basnam $name"
=outputproc(mail, "=diff =hstdir/$basnam $name")
output mail =newline
endif
endif
SEE ALSO
$dirname()
String Functions
Numerical Functions