Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Minecraft chat logger

Name: Anonymous 2011-01-09 5:53

Hi /prog/,

I have a problem with a Bash script.
I tried to write a little script to create a chat only log for minecraft.
The script is here:
http://pastebin.com/6TVkgvsc

However, when I test it, this is written to chat.log:

21:02:17 <tim> blah
21:03:49 <tim> hi
21:06:13 <tim> test
21:06:13 <tim> test
<tim> test
<tim> dayum
21:07:52 <tim> dayum
21:07:52 <tim> dayum
21:10:08 <tim> talk
21:10:08 <tim> talk
21:10:08 <tim> talk
<tim> talk

I said all those things only once.

I have no fucking idea why this happens.
For each message, the output of the script is just once "not the same; updating", it's not like Minecraft was just nog finished with logging.

Could someone help me out here?

Name: Anonymous 2011-01-09 6:39

>>6
You really are a faggot and you should get the fuck out of {spoiler /prog/} because if it sucks it's because of people like you, but I'm going to help you:

last=""
while get the next line, put it in $line; do
  if [[ $line == $last ]]; then
    # it's the same as the last line, don't print
  else
    last="$line"
    print $line
  fi
done
# repeat

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List