about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-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}