1Fsdb::Filter::dbrow(3)User Contributed Perl DocumentationFsdb::Filter::dbrow(3)
2
3
4

NAME

6       dbrow - select rows from an Fsdb file based on arbitrary conditions
7

SYNOPSIS

9       dbrow [-vw] CONDITION [CONDITION...]
10

DESCRIPTION

12       Select rows for which all CONDITIONS are true.  Conditions are
13       specified as Perl code, in which column names are be embedded, preceded
14       by underscores.
15

OPTIONS

17       -v  Invert the selection, picking rows where at least one condition
18           does not match.
19
20       This module also supports the standard fsdb options:
21
22       -d  Enable debugging output.
23
24       -w or --warnings
25           Enable warnings in user supplied code.
26
27       -i or --input InputSource
28           Read from InputSource, typically a file name, or "-" for standard
29           input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue
30           objects.
31
32       -o or --output OutputDestination
33           Write to OutputDestination, typically a file name, or "-" for
34           standard output, or (if in Perl) a IO::Handle, Fsdb::IO or
35           Fsdb::BoundedQueue objects.
36
37       --autorun or --noautorun
38           By default, programs process automatically, but Fsdb::Filter
39           objects in Perl do not run until you invoke the run() method.  The
40           "--(no)autorun" option controls that behavior within Perl.
41
42       --header H
43           Use H as the full Fsdb header, rather than reading a header from
44           then input.
45
46       --help
47           Show help.
48
49       --man
50           Show full manual.
51

SAMPLE USAGE

53   Input:
54           #fsdb account passwd uid gid fullname homedir shell
55           johnh * 2274 134 John_Heidemann /home/johnh /bin/bash
56           greg * 2275 134 Greg_Johnson /home/greg /bin/bash
57           root * 0 0 Root /root /bin/bash
58           # this is a simple database
59
60   Command:
61           cat DATA/passwd.fsdb | dbrow '_fullname =~ /John/'
62
63   Output:
64           #fsdb      account passwd  uid     gid     fullname        homedir shell
65           johnh   *       2274    134     John_Heidemann  /home/johnh     /bin/bash
66           greg    *       2275    134     Greg_Johnson    /home/greg      /bin/bash
67           # this is a simple database
68           #  | /home/johnh/BIN/DB/dbrow
69

BUGS

71       Doesn't detect references to unknown columns in conditions.
72
73       END
74           #' for font-lock mode.
75           exit 1;
76

CLASS FUNCTIONS

78   new
79           $filter = new Fsdb::Filter::dbrow(@arguments);
80
81       Create a new dbrow object, taking command-line arguments.
82
83   set_defaults
84           $filter->set_defaults();
85
86       Internal: set up defaults.
87
88   parse_options
89           $filter->parse_options(@ARGV);
90
91       Internal: parse command-line arguments.
92
93   setup
94           $filter->setup();
95
96       Internal: setup, parse headers.
97
98   run
99           $filter->run();
100
101       Internal: run over each rows.
102
104       Copyright (C) 1991-2018 by John Heidemann <johnh@isi.edu>
105
106       This program is distributed under terms of the GNU general public
107       license, version 2.  See the file COPYING with the distribution for
108       details.
109
110
111
112perl v5.32.0                      2020-11-16            Fsdb::Filter::dbrow(3)
Impressum