aboutsummaryrefslogtreecommitdiff

Normalize environment across different systems

  • Only needs a sh-like shell to function (tested on sh, bash and zsh)
  • See documentation below for everything it offers and how to adjust it
  • Intended to be sourced by shells and shell-scripts
  • Modules are intended for a Linux-like system, variants directory includes other system specific modules
  • Modules should try to be generic, if not additional system specific modules can be added, do not modify software to normalize
  • Check Makefile for installation

Documentation

This document is auto-generated from shell-scripts sources

modifier @

Array variable or variadic argument

modifier =

Constant variable or argument

modifier :

Treat null variable or argument as unset

modifier ?

Error if variable or argument unset

modifier -

Default value if variable or argument unset

source normalize() [L1]

Normalize environment across different systems

Recommended shebang for scripts is /usr/bin/env sh (so PATH is used)
To enable source NORMALIZE_SRC (defaulting to /usr/local/share/normalize)
Shell options errexit and nounset are supported and can be enabled

variable NORMALIZE_SRC=:- [L8]

Current normalize library entry path

Imported and exported from the environment

source normalize.d/00-pre() [L1]

Fundamental utilities

function normalize_array_diff(array?, diff?) [L4]

Computes the difference of two colon separated arrays

source normalize.d/50-host() [L1]

Host and user configuration

variable HOSTNAME=:- [L4]

Host’s name

Imported and exported from the environment

variable USER=:- [L8]

User’s name

Imported and exported from the environment

variable UMASK=:- [L12]

User’s permission mask

Imported from the environment

source normalize.d/50-path() [L1]

Fundamental paths

variable TMPDIR=:- [L4]

Temporary directory

Imported and exported from the environment

variable HOME=:- [L8]

User’s personal directory

Imported and exported from the environment

variable PATH= [L13]

Executable search paths

Imported and exported from the shell

source normalize.d/99-post() [L1]

Normalize initialization

variable NORMALIZE_REEXEC=- [L4]

Set to non-null during sourcing to enable re-execution

Normally not needed unless a restart is required to apply changes