#!/bin/bash ##########start functions########## roomdir="/home/everyone/ircrooms" function joinroom () { read -p "What is the name of the room you would like to join/start : " roomname if [[ -e $roomdir/$roomname.html ]] then echo "$roomname.html exists - you will be talking in $roomname" choosename else echo "$roomname.html does not exist, it will be created and you will be talking in $roomname" sleep 1 echo " BInMe - Bash INstant MEssenger " &> $roomdir/$roomname.html choosename fi } function choosename () { read -p "What do you want your chat name to be: " chatname } function chat () { read -p "Message: " message echo "

$chatname: $message

" >> $roomdir/$roomname.html clear chat } ##########end functions########## ##########start program########## joinroom chat