I try to create a log file in Bash. I want to have colored text (green for good news, yellow for warning etc.) I am using console codes. When I execute in the terminal the command:
echo -e "\033[1;31m Some text here \033[0m"
I have a good output. My text is colored. The problems start when I want to put such a line in the file. I put a line: \033[1;31m Some text here \033[0m into a file. Then I opened this file using cat command. The output is:
\033[1;31m Some text here \033[0m
This is exactly the same line that I entered into the file. Colors are not displayed. Is it possible to display colored text (console-codes) with the command cat? What I am doing wrong? Thanks for your help!