Skip to content
andychu edited this page Sep 23, 2017 · 33 revisions

The shell has interacts with a set of Unix tools in /bin and so forth. However, in many cases, those tools have grown functionality that overlaps with shell.

Unix Tools ...

That Start Processes (in parallel)

  • make and other build tools. make -j for parallel builds.
  • xargs, -P for parallel execution, -I {} for substitution
    • Also GNU Parallel, which is mentioned in the bash manual
  • find -exec and -exec +

That Have Expression Languages

Expression languages must be fully recursive to count here.

With no lexer:

  • find -- -a -o ! ( )
  • test -- -a -o ! ( )
  • expr -- arithmetic, subsumed by $(())

Languages with lexers:

  • awk

That Use Regexes

  • grep
  • sed
  • awk
  • expr
  • bash itself

That Receive Code Snippets (Remote Evaluation)

  • tar has a --sed option

That Have Printf-Style Formatting

See Appendix A: How to Quickly and Correctly* Generate a Git Log in HTML

  • find -printf (arbitrary filenames)

  • stat -c (arbitrary filenames)

  • git log --pretty=format: (arbitrary descriptions)

  • curl --write-out %{response_code} -- URLs can't have arbitrary characters?

  • printf itself (coreutils)

  • time (/usr/bin/time) -- mostly numbers

  • date -- mostly numbers

  • bash

    • the printf builtin
    • the time builtin and the TIMEFORMAT string -- mostly numbers
    • the prompt string: \h \W
  • ps --format

With Tabular Output

  • find / ls
  • ps
  • df (has -h and -H human-readable option, but no format string)

The Worst Offender

find starts processes (in parallel), it has regexes (and globs), and it has field substitution. It should be part of the shell!

Clone this wiki locally