DBROW(1)

πŸ“¦
version 3.9 Β· 3 versions
, in epel 9

πŸ’… DBROW(1) β€” the dbrow page, bestie edition πŸ’…

okay so real talk: this is dbrow, and it's a user-contributed Perl thing (iykyk 🌸). The whole thing is select rows from an Fsdb file based on arbitrary conditions. That's the vibe. That's the whole assignment. ✨


🌈 NAME 🌈

dbrow β€” select rows from an Fsdb file based on arbitrary conditions. That's it, that's the girl. πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

dbrow [-vw] CONDITION [CONDITION...]

πŸŽ€ DESCRIPTION πŸŽ€

So the way this works is: it selects rows for which all the CONDITIONS are true. All of them. Every single one. No skipping. πŸ”₯

Conditions are specified as Perl code, and here's the cute part β€” you embed column names in them, preceded by underscores. That's the little underscore moment. _fullname, etc. Obsessed. πŸ’œ


✨ OPTIONS ✨

  • -v β€” inverts the selection, picking rows where at least one condition does not match. Iconic contrarian behavior. πŸ™ˆ

This module also slays the standard fsdb options, no cap:

  • -d β€” enable debugging output.
  • -w or --warnings β€” enable warnings in user supplied code. (Your code. Yes, yours. 🫢)
  • -i or --input InputSource β€” read from InputSource, typically a file name, or - for standard input, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
  • -o or --output OutputDestination β€” write to OutputDestination, typically a file name, or - for standard output, or (if in Perl) a IO::Handle, Fsdb::IO or Fsdb::BoundedQueue objects.
  • --autorun or --noautorun β€” by default, programs process automatically, but Fsdb::Filter objects in Perl do not run until you invoke the run() method. The --(no)autorun option controls that behavior within Perl. main character energy, honestly. ⭐
  • --header H β€” use H as the full Fsdb header, rather than reading a header from then input. (That's the original wording, bestie, I'm not touching it. 😭)
  • --help β€” show help.
  • --man β€” show full manual. (Hiiii, you're here! πŸŽ€)

🌸 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 | dbrow '_fullname =~ /John/'

πŸ’– Output:

#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
# this is a simple database
#  | /home/johnh/BIN/DB/dbrow

like… it literally did that. πŸ’…


πŸ’€ BUGS πŸ’€

Doesn't detect references to unknown columns in conditions. ngl that's a lil bit of a yikes, but we move. πŸ¦‹

Then there's this trailing bit that's just… sitting there. Not me questioning it. Keeping it exactly as it is because facts are facts:

END
    #' for font-lock mode.
    exit 1;

Copyright (C) 1991-2018 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. 🫢


and that's the whole page, bestie β€” brought to you by perl v5.32.1, dated 2024-08-02. slay, go filter some rows. πŸŒˆβœ¨πŸ’–

πŸ“¦ where this page comes from