Is possible to use sed to change the background color of tabs (or any other text), so that, for example, I could run something like the following?
somefunction | sed -e 's/(some pattern)/(set bg color)\1(unset bg color)/g'
Yes:
#!/bin/bash
norm_bg=$(tput sgr0)
red_bg=$(tput setab 1)
echo -e "foo\tbar\tbaz" | sed "s/\t/$red_bg $norm_bg/g"
See this link for other Color Codes (very bottom)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With