# get console input and put the string to IRC function cons_input() { while true; do read CONSINPUT <&6 echo -en "PRIVMSG ${BOTCHAN} :${CONSINPUT}\r\n" CONSINPUT="" done } cons_input & export CONSINPTPID="$!" while read SERVERINPUT; do # main part done