Hi all,
This is my first ever posting, so please be gentle with me
I'm trying to write a script in HP-UX which outputs text in different colours, but although I can get the script to output different colours to the screen, I can't get it to write different colours to a file. Take the following example:
FGNORMS=$(printf "\033[m")
FGGREEN=$(printf "\033[1;32m")
FGBLUE=$(printf "\033[1;36m")
echo $FGGREEN"Business Unit 9 Totals : "$FGNORMS
echo $FGBLUE"Business Unit 9 Totals : "$FGNORMS
echo $FGGREEN"Business Unit 9 Totals : "$FGNORMS >> testlogfile.txt
echo $FGBLUE"Business Unit 9 Totals : "$FGNORMS >> testlogfile.txt
When I run it from my terminal, it outputs:
Business Unit 9 Totals :
Business Unit 9 Totals :
where the first line is green, and the second is blue.
The testlogfile.txt, however, shows:
^[[1;32mBusiness Unit 9 Totals : ^[[m
^[[1;36mBusiness Unit 9 Totals : ^[[m
with no colours.
Anyone help me please?