One Liners

A OneLiner? is a script (written in, for instance, shell or perl) that fits onto a single line. For instance you could type:

"ls -ls | sort -n"

to sort your files by size (Unix/Linux). Or you could type:

"perl -ane '$tot += $F[3]'; END { print $tot;}"

to print the total of the 4th whitespace-separated field from the standard input.

I've always been fond of the following SedLanguage one liner:

  G
That's right. Just one "G". It double spaces the input. See http://sed.sourceforge.net/sed1line.txt for more OneLiners in SedLanguage.


EditText of this page (last edited September 14, 2004) or FindPage with title or text search