/* Remove remarks of a Shell or equivalent script (e.g. BareED.cfg) */ BAREED_HOST = GetClip('BAREED') IF BAREED_HOST = '' THEN DO CALL SetClip('BAREED') /* Remove from ClipNode */ EXIT 5 END ADDRESS VALUE BAREED_HOST CALL SetClip('BAREED') /* Remove from ClipNode */ OPTIONS RESULTS /* ---------------------- MAIN --------------------- */ casetell "WARNING"'0a'x'0a'x"Going to remove all tabs and also"'0a'x"remarks introduced by a semicolon"'0a'x'0a'x"Sure to go ahead?" IF RESULT == 0 THEN EXIT set findmode set find string ";" terminate = 0 /* Delete remarks */ DO WHILE terminate == 0 find next string terminate = RC IF RC ~= 0 THEN BREAK delete to lineend move cursor left get current char IF RC == 0 THEN DO IF C2D(RESULT) == 10 THEN delete current char END END set find string '09'x set replace string '0a'x move cursor archivestart replace all set find string '0a'x||'0a'x set replace string '0a'x move cursor archivestart replace all /* Delete first line of file if it is a remark */ move cursor archivestart get current char IF RESULT == ";" THEN delete current line