diff options
author | Case Duckworth | 2022-04-13 17:08:29 -0500 |
---|---|---|
committer | Case Duckworth | 2022-04-13 17:08:29 -0500 |
commit | bc2772d47015d69ddb35c3cfb034aae66dabdd7a (patch) | |
tree | 59295fbb76bedab8646e49fea59fbdd9b9eb5aa8 | |
parent | Change commentary style (diff) | |
download | etc-bc2772d47015d69ddb35c3cfb034aae66dabdd7a.tar.gz etc-bc2772d47015d69ddb35c3cfb034aae66dabdd7a.zip |
Add functions
-rw-r--r-- | bash/functions.bash | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bash/functions.bash b/bash/functions.bash index de6c37a..cce92be 100644 --- a/bash/functions.bash +++ b/bash/functions.bash | |||
@@ -9,3 +9,22 @@ memq() { # memq ITEM ARRAY | |||
9 | done | 9 | done |
10 | return 1 | 10 | return 1 |
11 | } | 11 | } |
12 | |||
13 | rebashrc() { # rebashrc | ||
14 | ## Reload ~/.bashrc | ||
15 | printf "Loading ~/.bashrc..." >&2 | ||
16 | if source "$HOME/.bashrc"; then | ||
17 | echo "OK." >&2 | ||
18 | else | ||
19 | echo "ERROR!" >&2 | ||
20 | fi | ||
21 | } | ||
22 | |||
23 | first_which() { # first_which COMMAND... | ||
24 | ## Return the fully-qualified path of the first COMMAND found in $PATH. | ||
25 | while :; do | ||
26 | command -v "$1" && break | ||
27 | [ -z "$1" ] && return 1 | ||
28 | shift | ||
29 | done | ||
30 | } | ||