#!/bin/sh
#
# this scriptie removes last line from all scrollback files that 
# have this rogue string, assuming xchat stopped logging to the file on receiving the string.
#
# it creates a backup of your logs to <filename>.poison prior to cleaning the original file
# Don't post this file content or parts of it on any IRC channel, as that will
# earn you a permanent immediate ban on the whole network!
#
# since I wrote the whole thing as a busybox compatible oneliner, you also could
# just c&p the one line below to your xterm and execute it there, rather than
# downloading, storing on N900 ~user/, setting chmod +x, and then executing the file

[ 29999 == "$UID" ] && ( cd ~/.xchat2/scrollback/; for f in $(find . -name "*.txt"); do echo "checking $f"; if grep -q 'ÂÊÎÔÛâêîôûĈĉĜĝĤĥĴĵŜŝŴŵŶŷˆ᷍ḒḓḘḙḼḽṊṋṰṱṶṷẐẑẤấẦầẨẩẪẫẬậẾếỀềỂểỄễỆệỐốỒồỔổỖỗỘộ' $f; then echo "######################found rogue string in $f"; cp $f ${f}.poison; sed -i '$ s/.*//' $f; fi; done ) || echo "you should log in as user, or >su - user<, aborting"
