Data Input Macros

The macros in the sample data_input_macros.cfg configuration file below are intended for use with the Pikt data (or dat) statement.  Use them as shortcut specifications of common data inputs.

///////////////////////////////////////////////////////////////////////////////
 
// data input macros - script data input
 
///////////////////////////////////////////////////////////////////////////////

line            dat     $line           1,$
 
///////////////////////////////////////////////////////////////////////////////

inputproc(P, T) // do an 'input proc' of proc (P)
                // timeout after (T) seconds if necessary
                input proc "=maxtime (T) (P)"
 
///////////////////////////////////////////////////////////////////////////////

dfinput         // df display for all disks
                input proc "=dfk | =behead(1)"
 
///////////////////////////////////////////////////////////////////////////////

dflinput        // df display for local disks
                input proc "=dfl | =behead(1)"
 
///////////////////////////////////////////////////////////////////////////////

dfdata
                dat     $fsname         1
                dat     #kbytes         2
                dat     #used           3
                dat     #avail          4
                dat     #cap            5
                dat     $mount          6
 
///////////////////////////////////////////////////////////////////////////////

dfidata
#if linux
                dat     $fsname         1
                dat     #free           4
                dat     #used           5
                dat     $mount          6
#else
                dat     $fsname         1
                dat     #free           3
                dat     #used           4
                dat     $mount          5
#endif
 
///////////////////////////////////////////////////////////////////////////////

dffilter        // set this to =piktnullchar if no filtering at all
#if ! ( appserver | linux)
                filter "=egrep -v '^(/cdrom|/mnt|/proc|/usr/local|/opt/local)$'"
#else
                filter "=egrep -v '^(/cdrom|/mnt|/proc)$'"
#endif
 
///////////////////////////////////////////////////////////////////////////////

lldata
                dat     $access         1
                dat     #links          2
                dat     $owner          3
                dat     $group          4
                dat     #size           5
                dat     $mon            6
                dat     $date           7
                dat     $time           8
                dat     $name           9
 
///////////////////////////////////////////////////////////////////////////////

rlpchkdata
                dat     $host           1
                dat     $queue          2
                dat     $queuing        3
                dat     $printing       4
                dat     #entries        5
                dat     #activity       6
                dat     $connection     7
 
///////////////////////////////////////////////////////////////////////////////

passwddata
                dat     $username       [1]
                dat     $password       [2]
                dat     $uid            [3]
                dat     $gid            [4]
                dat     $gecos          [5]
                dat     $homedir        [6]
                dat     $shell          [7]
 
///////////////////////////////////////////////////////////////////////////////

groupdata
                dat     $group          [1]
                dat     $password       [2]
                dat     $gid            [3]
                dat     $grpmem         [4]
 
///////////////////////////////////////////////////////////////////////////////

wdata
#if solaris
                dat     $user           [1,8]
                dat     $tty            [10,16]
                dat     $idle           [20,27]
                dat     $cmd            [30,$]
#elif linux
                dat     $user           [1,8]
                dat     $tty            [10,16]
                dat     $idle           [36,42]
                dat     $cmd            [44,$]
#endif
 
///////////////////////////////////////////////////////////////////////////////

For more examples, see Samples.

 
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
History
Logging