diff --git a/rc/01-functions.sh b/rc/01-functions.sh index d033d0b..0a38f06 100644 --- a/rc/01-functions.sh +++ b/rc/01-functions.sh @@ -1,4 +1,4 @@ -# $LWS/rc/functions.sh +# Linux Workspace Functions function xlog() { if true_false "$LWS_DEBUG"; then @@ -21,6 +21,18 @@ function utime() { date '+%s.%N' } +function sqltime() { + date '+%Y-%m-%d %H:%M:%S' +} + +function lines() { + tr ":" "\n" +} + +function path() { + echo "$PATH" | lines +} + function in_path() { [[ "$PATH" =~ (^|:)"${1}"(:|$) ]] } @@ -49,6 +61,10 @@ function prepend_path_try() { fi } +function remove_path() { + PATH=$(path | grep -v "$1" | tr "\n" ":") +} + function uniq_path() { echo "$PATH" | tr ":" "\n" | awk '!seen[$0]++' | tr "\n" ":" | sed -r 's/:+/:/g' | sed -r 's/^:|:$//g' } diff --git a/rc/02-aliases.sh b/rc/02-aliases.sh index 9c1b966..e7e9fa7 100644 --- a/rc/02-aliases.sh +++ b/rc/02-aliases.sh @@ -34,14 +34,11 @@ alias kl=kubectl alias kld='kubectl describe' alias klg='kubectl get' -alias lines='tr ":" "\n"' - # Extra space! alias sudo='sudo ' alias ncdu='ncdu --color dark' -alias path='echo -e ${PATH//:/\\n}' alias now='date "+%T"' alias sqldate='date "+%Y-%m-%d %H:%M:%S"' diff --git a/rc/99-local.sh b/rc/zz-local.sh similarity index 56% rename from rc/99-local.sh rename to rc/zz-local.sh index d0d0320..497b126 100644 --- a/rc/99-local.sh +++ b/rc/zz-local.sh @@ -1,4 +1,5 @@ # Load user locals bashrc source_directory_sh "$LWS/rc.local" +# user operations are in the end to have change to change everyting/anything source_directory_sh "$HOME/.bashrc.d"