A Weird Imagination

Emotional error messages

Posted in

Cowardly tar

$ tar c
tar: Cowardly refusing to create an empty archive
Try 'tar --help' or 'tar --usage' for more information.

That's what the GNU implementation of tar says. For comparison, Debian includes FreeBSD's implementation of tar in the bsdtar package as the bsdtar command:

$ bsdtar c
bsdtar: no files or directories specified

Clingy lynx

In the text-only web browser lynx (not to be confused with links), if you press q to quit, it asks

Are you sure you want to quit? (y)

Most keys quit the program, but if you decide not to quit and press n for no, lynx shows the message


which goes away after a couple seconds allowing you to continue browsing.

sh Rube Goldbergs

Posted in

The problem

The command-line is an expressive interface which allows powerful commands to be written concisely. Sometimes you want a longer, less direct way of implementing a task. For example, merely writing wc -l is far too straightforward for counting lines in a file. Surely we can devise a more convoluted way to accomplish that task.

The solution

cat "$file" |
    expr $(od -t x1 |
    sed 's/ /\n/g' |
    grep '^0a$' |
    sed -z 's/\n//g' |
    wc -c) / 2

The details

Read more…

Man Humor

Posted in

man (and its lesser known cousin apropos) are invaluable resources for using the command-line on Linux. While the information is useful, sometimes they can also be entertaining, particularly in the BUGS sections. Some due to being overly honest like nethack's which merely states

Probably infinite.

or bash's which admits

It's too big and too slow.

My personal favorite is the passage in the BUGS section for xargs, which, after a two paragraph long discussion on the interaction between the -i, -I, and -s flags finally concludes

Instead, the -i option should not impose a line length limit, which is why this discussion appears in the BUGS section.

Some have comments that are merely strange, like the BUGS section for screen, which, among many other comments, includes the bug

A weird imagination is most useful to gain full advantage of all the features.

which is where this blog gets it name.