irctk

libircclient binding for scripts
git clone https://a3nm.net/git/irctk/
Log | Files | Refs | README

track.sh_disabled (557B)


      1 #!/bin/bash
      2 
      3 trap "kill 0" SIGINT SIGTERM EXIT
      4 
      5 mkdir -p track
      6 cd track
      7 mkfifo fifo 2>/dev/null
      8 
      9 (cat fifo | while read l; do seq 3 | sed -u "s/^/$l/"; done | ../../irctk -Frt trackr@localhost \#track_test >fifo) &
     10 PID=$!
     11 sleep 1
     12 cat > say <<EOF
     13 trackr: a
     14 /nick trackb
     15 blah
     16 bleh
     17 blouh
     18 trackr: b
     19 /nick trackc
     20 bleuh
     21 blih
     22 bloh
     23 trackr: c
     24 /nick trackd
     25 grih
     26 groh
     27 EOF
     28 cat say | ../../irctk -I5 -F tracka@localhost \#track_test >heard
     29 sleep 2
     30 kill $PID
     31 
     32 for l in a b c
     33 do
     34   seq 3 | sed -u "s/^/$l/" > ref$l
     35 done
     36 
     37 diff <(cut -d' ' -f4- heard) <(cat refa refb refc)
     38