Find file
aa2380c Oct 16, 2010
48 lines (29 sloc) 1.26 KB


Blog post: Command-line One-liner Challenges

Watch this project, I'll add more challenges over time.

How it works

There are 4 files to know about:

  • input.txt -- The input file.
  • -- What you need to run. Some implementation is missing.
  • actual.txt -- The output of the transformed input.txt. Created by running
  • expected.txt -- What input.txt needs to be transformed into.

Each directory contains two subdirectories: problem and solution. The only difference between problem and solution directories is the content of file.

In the problem directory, you need to implement the convert function inside This is always the same, a passthrough function:

convert() {
  cat "$@"

You are aiming for a one-liner. It should be as functional as possible: no variables, temporary files, or side-effects.



There is still work to do if you get:

Files actual.txt and expected.txt differ

If you are debugging, you can change the diff command to whatever suits you:

DIFF=vimdiff ./


DIFF="diff -u" ./