Grep issue with ls --color=always on terminator
Hello everybody. :)
If I open up a terminal (I use terminator) and I try something like Code:
ls --color=always /dev/sda* | grep '[0-9]' Code:
/dev/sda Code:
ls --color=never /dev/sda* | grep '[0-9]' Code:
/dev/sda1 EDIT: The same applies if I type Code:
ls --color=always /dev/sda* | grep '0' |
Neither of the outputs is wrong - you got what you asked for. An obvious line of endeavour would be to see what the colour codes generate.
Most notably how many, and which, contains a zero character. |
reported above post.
|
Quote:
|
It is because the colour code contains a digit
try this Code:
ls --color=always /dev/sda* |cat -A - which the term renders to colour Code:
[[0m^[[40;33;01m/dev/sda^[[0m$ Code:
grep 'a[1-9]' |
All times are GMT -5. The time now is 01:35 AM. |