The tag has no wiki summary.

learn more… | top users | synonyms

19
votes
5answers
9k views

Removing control chars (including console codes / colours) from script output

I can use the "script" command to record an interactive session at the command line. However, this includes all control characters and colour codes. I can remove control characters (like backspace) ...
3
votes
2answers
367 views

Unix Shell and colours

Can any one please help me understand this code snippet that I found in .profile file echo -en "\e[32;44m $(hostname) \e[m";echo -e "\e[m"
4
votes
1answer
611 views

Reverse control-code look up for terminals

My understanding is that terminals often use ANSI control-codes to represent non-alphanumeric character sequences. For example, when editing .inputrc for Bash in Linux, it's easy to find code ...
4
votes
1answer
621 views

Re-escape brackets in PS1

As others have pointed out, color codes in PS1 should be bracketed by \[ and \] to avoid them taking up horizontal space. I've added the necessary code to .bashrc: highlight() { if [ -x ...
12
votes
2answers
2k views

Where do my ANSI escape codes go when I pipe to another process? Can I keep them?

I sometime want to pipe the color-coded output fror a process, eg. grep... but when I pipe it to another process, eg. sed, the color codes are lost... Is the some way to keep thes codes intact ? ...