View Single Post
Old 07-19-2007, 10:33 AM   #4
Antartica
Evangelist
Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.Antartica ought to be getting tired of karma fortunes by now.
 
Antartica's Avatar
 
Posts: 423
Karma: 1517132
Join Date: Jun 2006
Location: Madrid, Spain
Device: quaderno, remarkable2, yotaphone2, prs950, iliad, onhandpc, newton
Quote:
Originally Posted by Adam B. View Post
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

Last edited by Antartica; 07-19-2007 at 10:35 AM. Reason: Clarification
Antartica is offline   Reply With Quote