backslash fix

preserving backslashes, that 'sed' stripped away
This commit is contained in:
committer@tuxwarrior
2026-03-18 14:26:02 -05:00
parent 7bb9f7c2ef
commit 743d543f86
2 changed files with 11 additions and 3 deletions

View File

@@ -40,12 +40,21 @@ else
echo "prefs=${prefs}"
custState=$(grep -i "browser.uicustomization.state" ${prefs})
echo ""
echo ${custState}
echo ""
# update user.js in the repo
# case sensitive replace:
# flags: -i edit file in place, c - replace the line
# sed -i "/search_string/c replacement_string" ${filename}
# case insensitive replace:
sed -i "/user_pref(\"browser\.uiCustomization\.state\"/I s/.*/${custState}/" ${trg}
# move old settings from the target file
sed -i '/browser.uiCustomization.state/d' ${trg}
# add new settings to the target file
echo ${custState} >> ${trg}
more ${trg}
fi