INNER CODE UNIT · Shell
value
IAmStoxe/wirehole · scripts/migrate-from-v1.sh:73
value = substr($0, length(key) + 2)
if (value ~ /^".*"$/ || value ~ /^'\''.*'\''$/) {
value = substr(value, 2, length(value) - 2)
}
found = value
}
END { print found }
' .env
}
# Read the exact right-hand side so a quoted password keeps its dotenv
# escaping when it moves to the new variable name.
old_get_raw() {
local key="$1"
awk -v key="$key" '
index($0, key "=") == 1 {
found = substr($0, length(key) + 2)
}