this is the script color
#!/bin/bash
ESC_SEQ="\x1b["
COL_RESET=$ESC_SEQ"39;49;00m"
case $1 in
red ) COL_START=$ESC_SEQ"31;01m"
;;
green) COL_START=$ESC_SEQ"32;01m"
;;
yellow ) COL_START=$ESC_SEQ"33;01m"
;;
blue ) COL_START=$ESC_SEQ"34;01m"
;;
mage ) COL_START=$ESC_SEQ"35;01m"
;;
cyan ) COL_START=$ESC_SEQ"36;01m"
;;
esac
echo -ne $COL_START
while read text;
do
echo $text
done
echo -ne $COL_RESET
when i do
curl localhost:8080/
it responds with the usual curl outputm HOOOOORAY!
when i do
curl localhost:8080/ | color red
it does not color the output how I expect it to ...... `CRY'
I don`t think I am calling read correctly for the situation.