All pastes #464520 Raw Edit

ryanakca

public text v1 · immutable
#464520 ·published 2007-04-29 15:46 UTC
rendered paste body
What's being processed: #ryanakca <@Quizbuntu> ryanakca: ping
What I want it to be changed to: #ryanakca <b><@Quizbuntu></b> ryanakca: ping
What's being process ex #2: #ubuntu <JohnSmith> ryanakca: How do you add ?
to:                         #ubuntu <b><JohnSmith></b> ryanakca: How do you add ?

What the script does in the 'while' part is assign '#channelname' to 'heading', and '<nick> message' to 'message'. notify-send then pops up a bubble. the "&lt;" in the original version is because sed was cutting off the initial '<' in '<nick>'

ORIGINAL:
#!/bin/sh

ssh 192.168.1.101 ": > .irssi/fnotify ; tail -f .irssi/fnotify " |
sed -u 's/[<@&]//g' | while read heading message;
do  /usr/bin/notify-send -u critical -c im.received -i /usr/share/icons/default.kde/48x48/apps/edu_languages.png -t 300000 -- "${heading}" "&lt;${message}";
done


CURRENT:
#!/bin/sh

ssh 192.168.1.101 ": > .irssi/fnotify ; tail -f .irssi/fnotify " |
sed 's#^<\([^<>]*\)>#<b>&</b>#g' | while read heading message;
do  /usr/bin/notify-send -u critical -c im.received -i /usr/share/icons/default.kde/48x48/apps/edu_languages.png -t 200000 -- "${heading}" "&lt;${message}";
done

FAILED TEST:
#!/bin/sh

ssh 192.168.1.101 ": > .irssi/fnotify ; tail -f .irssi/fnotify " |
sed 's#<\([^<>]*\)>#<b>&</b>#g' | while read heading message;
do echo "{heading} &lt;${message}";
done