Quote:
Originally Posted by Adam B.
I've started playing with SED in order to add new viewers to the registry. I've tested this on my PC, but I forgot my iLiad at home. It seems to work pretty well. Does anyone have any comments, suggestions, etc, for my scripts?
|
Suggestion: make it idempotent (that is, appliying twice the script have nil effect).
For that the easiest way is to first "unsinstall" the script changes (just in case it has been run before), and only then do the changes.
Examples:
For deleting and then re-adding the uaIDList part:
s/\(uaIDList=.*\)FBREADER;\(.*\)/\1\2/g;s/\(uaIDList=\)/\1FBREADER/g
For deleting the chunk:
/^\[FBREADER\]/,/extensions=chm;CHM;fb2;FB2;rtf;RTF;tcr;TCR;oeb;OEB/d