aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Riedstra <mitch@Mitchells-MacBook-Air.local>2019-12-07 09:02:03 -0500
committerMitch Riedstra <mitch@riedstra.us>2019-12-07 09:02:48 -0500
commit5dc98357f380a586f82a5e8bf27d378665181418 (patch)
tree49007cf1bfe363ac1e821d696a1d1ddc8ab4f290
parent701126f58307ebd4918b26ce705f3b5793741f36 (diff)
downloaddotfiles-5dc98357f380a586f82a5e8bf27d378665181418.tar.gz
dotfiles-5dc98357f380a586f82a5e8bf27d378665181418.tar.xz
Update the _sys_load and _sys_uptime functions to work on latest MacOS
-rw-r--r--mkshrc4
-rw-r--r--shell/utils4
2 files changed, 4 insertions, 4 deletions
diff --git a/mkshrc b/mkshrc
index 4ef426f..98533b7 100644
--- a/mkshrc
+++ b/mkshrc
@@ -192,12 +192,12 @@ _sys_memory() {
_sys_load() {
# Works on BSD too, neat.
- uptime | sed -re's/^.*load averages?: ([0-9]+\.[0-9]+).*$/\1/g'
+ uptime | sed -E 's/^.*load averages?: ([0-9]+\.[0-9]+).*$/\1/g'
}
_sys_uptime() {
# Took awhile to figure out, but this works on BSD as well
- uptime | sed -re's/^.*up[ ]+//g' -e's/^([^,]*),.*/\1/g' -e's/^([^ ]+)[ ]*(.).*/\1\2/g'
+ uptime | sed -E -e's/^.*up[ ]+//g' -e's/^([^,]*),.*/\1/g' -e's/^([^ ]+)[ ]*(.).*/\1\2/g'
}
diff --git a/shell/utils b/shell/utils
index 2c45194..49b1985 100644
--- a/shell/utils
+++ b/shell/utils
@@ -100,12 +100,12 @@ _sys_memory() {
_sys_load() {
# Works on BSD too, neat.
- uptime | sed -re's/^.*load averages?: ([0-9]+\.[0-9]+).*$/\1/g'
+ uptime | sed -E 's/^.*load averages?: ([0-9]+\.[0-9]+).*$/\1/g'
}
_sys_uptime() {
# Took awhile to figure out, but this works on BSD as well
- uptime | sed -re's/^.*up[ ]+//g' -e's/^([^,]*),.*/\1/g' -e's/^([^ ]+)[ ]*(.).*/\1\2/g'
+ uptime | sed -E -e's/^.*up[ ]+//g' -e's/^([^,]*),.*/\1/g' -e's/^([^ ]+)[ ]*(.).*/\1\2/g'
}