title: Reply to IRC PING with PONG in bash script
body: <p>So far I have a basic IRC Bot which I hope to be able to successfully PRIVMSG myself with but on the server I am testing on it requires a PONG response to PING.</p>
  
  <p>I have absolutely no idea how to get around this. How do I reply to the PING?</p>
  
  <p>My current code:</p>
  
  <pre><code>    #!/bin/bash
  
  function ircpreamble {
  echo "NICK ${1}"
  }
  
  function privmsg {
  TARGET=$1
  sed -re "s/^(.*)\$/PRIVMSG ${TARGET} :\1/"
  }
  
  function delay {
  while read LINE; do
  sleep 2
  echo $LINE
  done
  }
  
  function messages {
  msg=`cat pmmsg.txt`
  echo $msg
  }
  
  function disconnect {
  echo "QUIT goodbye :)"
  }
  
  
  (   
  nick=`cat randnick.txt`
  pms=`cat pmnickname.txt`
  ircpreamble "$nick";
  messages | privmsg "$pms";
  disconnect;
  ) | delay | nc irc.seersirc.net 6667
  </code></pre>