#!/bin/bash if [ -z ${1} ] ; then printf "This script is for passing short messages to other users on the server, and yes, the \" is important\n" printf "Usage:\n" printf "${0} USER \"MESSAGE\"\n" exit 1 fi if [ -z ${2} ] ; then printf "This script is for passing short messages to other users on the server, and yes, the \" is important\n" printf "Usage:\n" printf "${0} USER \"MESSAGE\"\n" exit 2 fi getent passwd ${1} >/dev/null 2>&1 if [ $? -ne 0 ] ; then printf "ERROR: ${1} is not a valid user\n" exit 3 fi echo "${USER} says: $2" to /srv/ltsp/msg/${1}.fifo echo "${USER} says: $2" >> /srv/ltsp/msg/${1}.fifo