Every time I want to do something in the terminal, and I don't succeed to do it quickly with Bash and existing command-line tools, I hand-write a little C program to do it. It has been a nice way to learn basic C, and get some small working tools for my own workflows. I recommend it.
I put a few of them together with manpages and a makefile, as "ignoreutils" - named with respect to coreutils and moreutils packages, these being utils that you can probably ignore.
https://codeberg.org/lcpterid/ignoreutils
Current list:
- caser - Changes the case of text
- mathfont - Changes Latin and Greek letters and numbers to Unicode math characters
- hr - Makes a horizontal line across your terminal, with customisable ends and a centred message
- coin - Returns exit code 0 or 1 at random, with success probability of your choice
- bycontains - Returns whether one file's content is contained completely with another file
- byget - Gets a single byte from a given location in a file
- byset - Outputs a file, changing only one byte at a given location
- byseq - Generate binary sequences. Can be useful junk data for experiments with file storage or compression
- byreplace - Replace a portion of a file with the contents of another file, at a given location
- byinsert - Insert the contents of one file into another, at a given location
- byreverse - Reverse a file bytewise
- emoji - Search emoji by their standard description
- stem - Identify the common stem of all lines in a file
- leaves - Complementary output to stem: print a file with any common stem removed
- strep - Replace every instance of one string with another in a file. No regex.
Code: Select all
git clone https://codeberg.org/lcpterid/ignoreutils.git
cd ignoreutils
DESTDIR=build-porteus make install
cd build-porteus
sudo dir2xzm build-porteus ignoreutils-0.0.1.xzm
If you happen to have the optional Porteus module for local docs 06-man.xzm, then you can use the man command to see the ignoreutils manpages, but you may need to (sudo) edit /etc/man_db.conf and remove the hash (#) from the beginning of the line:
Code: Select all
#MANDATORY_MANPATH /usr/share/man
Code: Select all
DESTDIR=build-porteus DOCDIR=/usr/man make install





