Go to file
2019-09-19 10:56:28 +03:00
LICENSE.md docs: update 2019-09-19 10:36:16 +03:00
README.md docs: update 2019-09-19 10:56:28 +03:00

pure sh bible

A collection of pure POSIX sh alternatives to external processes

Table of Contents

STRINGS

Strip pattern from start of string

Example Function:

lstrip() {
    # Usage: lstrip "string" "pattern"
    printf '%s\n' "${1##$2}"
}

Example Usage:

$ lstrip "The Quick Brown Fox" "The "
Quick Brown Fox

Strip pattern from end of string

Example Function:

rstrip() {
    # Usage: rstrip "string" "pattern"
    printf '%s\n' "${1%%$2}"
}

Example Usage:

$ rstrip "The Quick Brown Fox" " Fox"
The Quick Brown