Fsdb::F...r::dbcol(3)
π dbcol β like, the manual page, but make it make sense β¨
Okay bestie, so this is Fsdb::F...r::dbcol(3) from the User Contributed Perl Documentation, and I'm gonna walk you through it like we're texting at 1am. Stay with me, it's actually so good. π«Ά
πΈ NAME πΈ
dbcol β pick which columns you want out of an Fsdb file. That's the whole vibe. π
β¨ SYNOPSIS β¨
dbcol [-v] [-e -] [column...]
π¦ DESCRIPTION π¦
So basically you're selecting one or more columns from the input database, periodt. π
Now here's the cute part: if you hand a value to the empty columns using the -e option, then any named columns that don't exist get created for you. Iconic. But if you don't do that? Non-existent columns are just an error, no cap. π
Note: a safer way to create columns is dbcolcreate. Just saying. π
π OPTIONS π
-r,--relaxed-errorsβ relaxed error checking, meaning it just ignores columns that aren't there. Very chill of it. π§-v,--invert-matchβ outputs all the columns except the ones you listed, exactly likegrep -v. Flip the script bestie. π₯-a,--allβ outputs all the columns, in addition to the ones you listed. (So like,-a foowill move columnfooto be the first column. Sneaky but slay.) π-eEmptyValue,--emptyβ specify the value that newly created columns get. π--saveoutput $OUT_REFβ save the output writer (this is for integration with other fsdb filters, iykyk).
And then there's the standard fsdb options, which are also giving main character energy:
-dβ enable debugging output. π-i,--inputInputSource β read from InputSource, which is typically a file, or-for standard input, or (if you're in Perl)IO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.-o,--outputOutputDestination β write to OutputDestination, typically a file, or-for standard output, or (if you're in Perl)IO::Handle,Fsdb::IOorFsdb::BoundedQueueobjects.--autorunor--noautorunβ by default, programs process automatically, butFsdb::Filterobjects in Perl do not run until you invoke therun()method. The--(no)autorunoption controls that behavior within Perl.--headerH β use H as the full Fsdb header, rather than reading a header from then input.--helpβ show help. π--manβ show the full manual. π
π SAMPLE USAGE π
Input:
#fsdb account passwd uid gid fullname homedir shell
johnh * 2274 134 John_Heidemann /home/johnh /bin/bash
greg * 2275 134 Greg_Johnson /home/greg /bin/bash
root * 0 0 Root /root /bin/bash
# this is a simple database
Command:
cat DATA/passwd.fsdb account | dbcol account
Output:
#fsdb account
johnh
greg
root
# this is a simple database
# | dbcol account
See how it justβ¦ kept account and dropped everything else? Obsessed. π
π SEE ALSO π
π CLASS FUNCTIONS π
new
$filter = new Fsdb::Filter::dbcol(@arguments);
Create a new dbcol object, taking command-line arguments. Fresh out the box. β¨
set_defaults
$filter->set_defaults();
Internal: set up defaults.
parse_options
$filter->parse_options(@ARGV);
Internal: parse options.
setup
$filter->setup();
Internal: setup, parse headers.
run
$filter->run();
Internal: run over all data rows. Go go go. π₯
finish
$filter->finish();
Internal: write trailer.
π AUTHOR and COPYRIGHT π
Copyright (C) 1991-2022 by John Heidemann <johnh@isi.edu>
This program is distributed under terms of the GNU general public license, version 2. See the file COPYING with the distribution for details.
Okay that's the whole thing, you ate that. π β¨
And for the sign-off, since you asked so nicely: this was perl v5.32.1, dated 2024-08-02, and yes, it's still Fsdb::F...r::dbcol(3) β mwah, bye bestie! πππ¦πΈ
π¦ where this page comes from
- epel 9: perl-Fsdb 2:3.9-1.el9 Β· GPLv2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms