Path manipulation functions
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
# $LWS/rc/functions.sh
|
||||
|
||||
function jql() {
|
||||
function jql() {
|
||||
jq -C . "$@" | less -r
|
||||
}
|
||||
|
||||
@@ -13,3 +14,21 @@ function ffile() {
|
||||
function utime() {
|
||||
date '+%s.%N'
|
||||
}
|
||||
|
||||
function in_path() {
|
||||
[[ "$PATH" =~ (^|:)"${1}"(:|$) ]]
|
||||
}
|
||||
|
||||
function append_path() {
|
||||
if ! in_path "$1"; then
|
||||
PATH="$PATH:$1"
|
||||
fi
|
||||
}
|
||||
|
||||
function prepend_path() {
|
||||
if ! in_path "$1"; then
|
||||
PATH="$1:$PATH"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user