about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2022-04-13 17:08:29 -0500
committerCase Duckworth2022-04-13 17:08:29 -0500
commitbc2772d47015d69ddb35c3cfb034aae66dabdd7a (patch)
tree59295fbb76bedab8646e49fea59fbdd9b9eb5aa8
parentChange commentary style (diff)
downloadetc-bc2772d47015d69ddb35c3cfb034aae66dabdd7a.tar.gz
etc-bc2772d47015d69ddb35c3cfb034aae66dabdd7a.zip
Add functions
-rw-r--r--bash/functions.bash19
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
13rebashrc() { # 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
23first_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}