Skip to content

Guideline for one_liners

linux-shell-base edited this page Dec 3, 2017 · 16 revisions

Guideline for one-liners in Shell.

  1. General
  2. Format
  3. Code style

General

A one-liner ...

  • has a description.
  • is continued on a single line (for easy maintenance of layout when copying and pasting to a script or terminal).

Format

One-liner files are created in the following format:
(Note: Any section in addition to Description is included if necessary)

# Description
one-liner

# Description
one-liner

# Description
# Note: Note
one-liner
  • Any other documentation section is included if necessary.

For an example, see one-liners-linux-output_only-single-value.bash.

Code style

General

Variables
  • A variable name uses acronyms whenever possible.

All other code style rules are up to the contributor.

Clone this wiki locally