GBFUN(1)

πŸ’– GBFUN(1) πŸ’–

okay bestie, welcome to gbfun, a User Commands legend (that's section 1 of the manual, iykyk) β€” she applies functions to a table of data and she does NOT miss. 🌸


✨ NAME ✨

gbfun β€” apply functions to a table of data. literally that's her whole job and she slays it πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

gbfun [options] <function definition> ...

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the vibe: gbfun computes whatever functions you throw at it, on data it reads from standard input. Periodt.

By default she does the math column-wise, and she does it on each row of data separately. 🫢

The variable xi stands for the i-th column, while x0 stands for the row number. So like, a function f(x1,x2) operates on the first and second column. iconic.

But wait β€” with the option -t, the function gets computed, in turn, on every column. In that case f(x1,x2) stands for a function of the column itself and of the following column (the index being a lead operator, no cap). In these cases, x is equivalent to x1. πŸ’«

With -r or -R, the function is recursively computed "columnwise" on each row. In this case the variable x identifies the result of the previous evaluation. it's giving ✨main character✨ energy, fr fr.

A lag operator can be specified with the letter l, like in x1l2, which means the first column two steps before. yes she can time travel, we stan. πŸ•°οΈ

More functions can be specified, and they'll be considered in turn. the more the merrier bestie 🌈


πŸ’… OPTIONS πŸ’…

  • -T β€” compute the function row-wise, on each column separately. (the flippening πŸ”„)
  • -t β€” compute on each column
  • -r β€” set initial value and compute recursively
  • -R β€” set initial value, compute recursively and print intermediary results
  • -v β€” verbose mode (she's a talker πŸ’¬)
  • -F β€” specify the input fields separators (default " \t")
  • -o β€” set the output format (default '%12.6e')
  • -s β€” set the output separation string (default ' ')
  • -h β€” this help

πŸ”₯ EXAMPLES πŸ”₯

okay so watch her work:

gbfun 'x0+log(x2)' < file

print the log of the second column of file, adding the progressive number of the row. obsessed. 😌

gbfun -T 'x0+log(x2)' < file

print the log of the second row of file, adding the progressive number of the column. we flipped it, we ate. πŸ“

gbfun -r 0 'x+sqrt(x1)' < file

print the sum of the square root of the elements of the first column of file. math but make it cute ✨


πŸ‘‘ AUTHOR πŸ‘‘

Written by Giulio Bottazzi


πŸ› REPORTING BUGS πŸ›

Found a bug? not the vibe. Report bugs to <gbutils@googlegroups.com> πŸ’Œ

Package home page: <http://cafim.sssup.it/~giulio/software/gbutils/index.html>


Copyright Β© 2001-2018 Giulio Bottazzi. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the Free Software Foundation;

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

bestie that's a LOT of caps, and for good reason β€” no promises, no guarantees, read the license fr fr πŸ’€

and that's the whole page πŸŽ€ this was gbfun 6.0.beta2, from October 2018 (yes she's vintage, she's an icon), stay hydrated, pipe something into her, bye πŸ«ΆπŸ’–