diff --git a/lochat.sh b/lochat.sh index 0c17c8f..50adff2 100755 --- a/lochat.sh +++ b/lochat.sh @@ -55,48 +55,28 @@ fi echo -e "${LCYAN}Type 'quit' to exit the chat${NC}\n" while true;do - - - #printf "${LGREEN}${person1}:${NC} " - read something1 + read something1 - if [ ! -z "${something1}" ];then - echo -e "${LGREEN}${person1}: ${something1}${NC}\n" - - - continue - - - - elif [ "${something1}" = "quit" ];then + if [ "${something1}" = "quit" ];then echo -e "${LRED}${person1} exited the chat!${NC}\n" exit 0 - else - continue + elif [ -n "${something1}" ];then + echo -e "${LGREEN}${person1}: ${something1}${NC}\n" fi - + #printf "${YELLOW}${person2}:${NC} " - read something2 + read something2 - if [ ! -z "${something2}" ];then - echo -e "${YELLOW}${person2}: ${something2}${NC}\n" - - - continue - - - - - elif [ "${something2}" = "quit" ];then + if [ "${something2}" = "quit" ];then echo -e "${LRED}${person2} exited the chat!${NC}\n" exit 0 - else - continue + elif [ -n "${something2}" ];then + echo -e "${YELLOW}${person2}: ${something2}${NC}\n" fi - + done