a command line utility that transforms stdin to stdout by sending user defined chunks through the specified filter https://git.lenzplace.org/lenzj/chuf
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.8 KiB


chuf is a command line utility that transforms stdin to stdout by sending predefined chunks through the specified FILTER. A chunk is defined by a BEGIN and END byte sequence within the stream. Anything not within a chunk is passed along unmodified.



BEGIN : Byte sequence designating beginning of chunk

END : Byte sequence designating end of chunk

FILTER : Command filter to transform chunk. A multiple parameter command filter must be enclosed in quotes.

Example 1 - Simple text markup using unix "tr" command.

$ echo "the quick {U}brown fox{R} jumped over the lazy dog" | \\
chuf {U} {R} "tr [:lower:] [:upper:]"
the quick BROWN FOX jumped over the lazy dog

Example 2 - Expand markdown within html document.

$ cat example.mdhtml
<!DOCTYPE html>
# Markdown table example

| Name   | Hobby        | Age   |
| ------ |:------------:| -----:|
| Bob    | golfing      |    18 |
| Monica | programming  |    32 |
$ chuf '<md>' '</md>' markdown < example.mdhtml
<!DOCTYPE html>
<h1>Markdown table example</h1>
<th> Name   </th>
<th style="text-align:center;"> Hobby        </th>
<th style="text-align:right;"> Age   </th>
<td> Bob    </td>
<td style="text-align:center;"> golfing      </td>
<td style="text-align:right;">    18 </td>
<td> Monica </td>
<td style="text-align:center;"> programming  </td>
<td style="text-align:right;">    32 </td>

Compiling from source


  • Go compiler (v1.12 or later).
  • Go package chunkio
  • Go package testcli to run tests.
  • scdoc utility to generate the man page. Only needed if changes to man page source (chuf.1.scd) are made.
  • pgot utility to process files in the templates sub folder. Only needed if changes to README.md, LICENCE, Makefile etc. are needed.


$ make
# make install

Running the tests

$ make check


If you have a bugfix, update, issue or feature enhancement the best way to reach me is by following the instructions in the link below. Thank you!



I follow the SemVer strategy for versioning. The latest version is listed in the releases section.


This project is licensed under a BSD two clause license - see the LICENSE file for details.