news.volyx.in

Moreutils: A collection of Unix tools that nobody thought to write long ago (joeyh.name)

612 points by escot · 1612 days ago · 258 comments on HN

Article summary

The article discusses moreutils, a collection of Unix tools that provide functionality not covered by existing tools. These tools include sponge, which allows for reading from and writing to the same file in a pipeline, and vipe, which inserts a text editor into a pipe. The collection is intended to fill gaps in the Unix toolbox and provide general-purpose tools that can be used in a variety of situations. The tools are available in a Debian package and can be downloaded from the project's website.

Main themes

  • Unix tools
  • shell redirection
  • exit codes
  • text editing
  • pipelines
  • command-line tools
  • standardization
  • flexibility and composability

What commenters say

  • Some users find the tool sponge useful for handling situations where shell redirection would truncate a file before it can be read as input.
  • The tool errno is not as useful as expected because it does not correspond to the exit codes of everyday command-line tools.
  • The sysexits.h specification provides a standard for exit codes, but it is not widely used.
  • The tool vipe can be used to edit input text before passing it to another function, but it can be problematic if the user wants to abort the operation after editing.
  • The use of vipe can be replaced with other tools such as fzf, which provides a more composable and flexible way of selecting and editing text.
  • Some users prefer to use other editors, such as micro, which can be used as a pipe editor without using temporary files.
  • The exit code of the editor used in vipe can be used to determine whether to proceed with the operation or not.
  • The tool moreutils provides a set of general-purpose tools that can be used to fill gaps in the Unix toolbox, but some users may find that they are not necessary or that they can be replaced with other tools.