Revision 14411
Added by Aaron Marcuse-Kubitza over 10 years ago
trunk/lib/sh/util.sh | ||
---|---|---|
8 | 8 |
|
9 | 9 |
realpath() { readlink -f -- "$1"; } |
10 | 10 |
|
11 |
lowercase() { tr A-Z a-z <<<"$1"; } |
|
12 |
|
|
11 | 13 |
str2varname() { echo "${1//[^a-zA-Z0-9_]/_}"; } |
12 | 14 |
|
13 | 15 |
include_guard_var() { str2varname "$(realpath "$1")"; } |
... | ... | |
42 | 44 |
|
43 | 45 |
#### stubs |
44 | 46 |
|
45 |
die() { return "$?"; } # can't use `:` because that resets $? |
|
47 |
die() |
|
48 |
{ return "$?"; } # can't use `:` because that resets $? |
|
46 | 49 |
|
47 | 50 |
alias log_local='declare PS4="$PS4" log_level="$log_level"' |
48 | 51 |
|
Also available in: Unified diff
lib/sh/util.sh: added lowercase()