Crie arquivos de teste
echo -e "\t foo-somethingfoo" >something.foo
echo " bar-bar-somethingbar" >something.bar_bar
echo "baz-baz-baz-somethingbaz" >something.baz_baz_baz
echo " spaces something s" >something.spaces
produz cores gloriosas completas:)
grep --colour=always "something" something.* |
sed -re 's/^([^:]+):(\x1b\[m\x1b\[K)[[:space:]]*(.*)/\x01/' |
column -s $'\x01' -t
saída (execute para obter a cor).
something.bar_bar bar-bar-somethingbar
something.baz_baz_baz baz-baz-baz-somethingbaz
something.foo foo-somethingfoo
something.spaces spaces something s
Testado em gnome-terminal
, konsole
, terminator
, xterm