add str_before and str_after

master
Kebler Network System Administrator 2023-01-20 10:09:56 -08:00
parent 96bb6113d7
commit 2e4ecc3539
2 changed files with 10 additions and 0 deletions

View File

@ -1,4 +1,13 @@
#!/bin/bash
str_after () {
echo "$1" | cut -s -d "${2:-=}" -f2
}
str_before () {
echo "$1" | cut -s -d "${2:-=}" -f1
}
# must be json as a string, depends on jq
get_prop_value () {
local value
@ -83,3 +92,4 @@ sed_ignore_comments () {
eval $cmd < /dev/stdin
fi
}