mirror of
https://github.com/jimeh/dotify.git
synced 2026-02-19 10:06:39 +00:00
The plan is to have a build script that will put together all files into a single executable again for easy inclusion in your own dotfiles. Breaking dotify apart simply makes it easier to work with and test.
14 lines
242 B
Bash
14 lines
242 B
Bash
# Trim leading and trailing whitespace.
|
|
#
|
|
# Example:
|
|
#
|
|
# $ trim " foo bar "
|
|
# foo bar
|
|
#
|
|
trim() {
|
|
local string="$@"
|
|
string="${string#"${string%%[![:space:]]*}"}"
|
|
string="${string%"${string##*[![:space:]]}"}"
|
|
echo -n "$string"
|
|
}
|