Hey, all,
I have been trying to make a script that will let me use read to take user input strings and set them as variables. I came across something on another forum, and modified it, to look like this:
Code:
URL_VISIT=""
read -n 1 -a CHAR -s
while [ "x$CHAR" != "x`echo -e "\e"`" ] ; do
echo $CHAR
URL_VISIT="$URL_VISIT$CHAR"
read -n 1 -a CHAR -s
done
echo Whole input was $URL_VISIT
I know almost nothing about programming, but am trying to learn. Anyway, I get the following error when I try to run my script"
Code:
read: 9: Illegal option -n
so far as I know -n is a legal option, and it works when I type the command manually, so perhaps a problem with the code?
Any help would be great.
Thanks,
Tekgek