Well using ls was just an example, the reason --color is needed for the ls command is that it normally detects that the output isn't a terminal and avoids outputting any color escape sequences. This is probably to simplify scripts that process the ls output.
Now unless your custom script has a similar feature i.e checking stdout and only outputting plain text when it's not a terminal this should all be fine.
Checking this script ansi2html.sh script it does require python, however it should be a pretty trivial exercise to change it to use awk instead.
Edit: Re-reading your posts I'm guessing your script does check the output type and only print the color escape sequences if the output is a terminal. It's probably checking [-t 1] or something similar. I've encountered this issue before myself and found using ssh is a nice workaround.
Say your script is called output_color then you could call it like this:
or using ls and an example:
Last edited by Chubler_XL; 03-24-2014 at 10:12 AM..
This User Gave Thanks to Chubler_XL For This Post:
Hello,
I am using RHEL 6.1 on VMware
I am searching for a way to change background color (not line by line color wich one can using tput command)
basically changing the color of the whole screen to white instead of the default black and changing font color to black and alos would like to... (2 Replies)
Hi All,
I have a file that contains following entries.
I want to highlight the line that has word as "FAILURE" while sending the email.
File
------------------------------------------------------------
Job Name: ABC
Start Time: 07/20/2019 07:32:39
End Time: 07/20/2019... (4 Replies)