OK, I made a simple script called "msg" to make it simpler to use the "wall" command, but it is giving me some issues. The problem is more cosmetic than performance, but it's annoying.
OS: Ubuntu 10.10
Text Editor: Nano (Probably not important, but hey...)
Here's what I got:
Code:
#!/bin/bash
# Changes color to yellow
tput setaf 3
echo "Type your message and press Enter:"
#Resumes normal color
tput sgr0
read message
#Checks is message is blank
if ["$message" -eq ] ; then
#Sets color to red
tput setaf 1
echo "ERROR: You didn't type anything to broadcast!"
#Resumes normal color
tput sgr0
else
#Changes color to green
tput setaf 2
echo "$message" | wall
#Resumes normal color
tput sgr0
fi
For the most part it does what it's supposed too, but when it's used, I get this:
Code:
jesse@UbuntAWESOME-2:/usr/sbin$ msg
Type your message and press Enter:
This is a test
/usr/sbin/msg: line 11: [This is a test: command not found
Broadcast Message from jesse@UbuntAWESOME-2
(/dev/pts/0) at 20:17 ...
This is a test
It works, but adds in that "/usr/sbin/msg: line 11: [This is a test: command not found." Any idea what is wrong? Obviously it's something with line 11 but I've tried everything I can think of.