irctk

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

order1.sh (557B)


      1 #!/bin/bash
      2 
      3 trap 'kill $(jobs -p)' EXIT
      4 
      5 mkdir -p order1
      6 cd order1
      7 
      8 cat >tosay <<EOF
      9 [#order1_test2] a
     10 [#order1_test2] b
     11 [#order1_test1,#order1_test2] c
     12 EOF
     13 cat > ref_message <<EOF
     14 [#order1_test2] <order1o> a
     15 [#order1_test2] <order1o> b
     16 EOF
     17 
     18 (sleep 5; cat tosay) |
     19   ../../irctk order1o@localhost \#order1_test1 \#order1_test2 2>/dev/null > /dev/null&
     20 sleep 1
     21 PID=$!
     22 tail -f /dev/null | ../../irctk order1m@localhost \#order1_test2 \#order1_test2 > heard_message &
     23 PID1=$!
     24 sleep 0.3
     25 wait $PID
     26 sleep 1
     27 kill $PID1
     28 
     29 diff ref_message <(head -2 heard_message)
     30