Resolve "lisbstd.bash: in function std::replace_path use empty string as default for 'replacestr'"

This commit is contained in:
2024-07-16 10:10:04 +02:00
parent 288ba4cc6f
commit cc6d88e79b
+1 -1
View File
@@ -152,7 +152,7 @@ std::remove_path() {
std::replace_path () {
local -r path="$1"
local -r removepat="$2"
local -r replacestr="$3"
local -r replacestr="${3:-''}"
local -r removestr=$(echo "${!path}" | tr ":" "\n" | grep -m 1 "^$removepat\$")
export $path="$(echo "${!path}" | tr ":" "\n" | sed "s:^${removestr}\$:${replacestr}:" |