#!/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 "
$chatname: $message
" >> $roomdir/$roomname.html clear chat } ##########end functions########## ##########start program########## joinroom chat