Created
June 8, 2020 09:37
-
-
Save arter97/47c70e6092f6c66f90d7b051ec425d92 to your computer and use it in GitHub Desktop.
dconf batch backup & restore (w/ meld)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dconf dump / | grep '^\[' | tr -d '\[' | tr -d '\]' | | |
while read a; do | |
( | |
dconf dump /$a/ | | |
sed -e 's@\[/\]@DUMMYPLACEHOLDER@g' | | |
sed -e '/DUMMYPLACEHOLDER/,$!d' | | |
tail -n+2 | | |
sed -e 's@^\[@DUMMYPLACEHOLDER@g' | | |
sed '/DUMMYPLACEHOLDER/,$d'; echo | |
) | | |
sort | sed '/^[[:space:]]*$/d' > $(echo $a | tr '/' '_') | |
done | |
ls | while read file; do | |
echo -n "["; echo -n $file | tr '_' '/'; echo "]" | |
cat $file | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment