When I use
sed -i "s,.*%.*,$(tput setaf 1)&$(tput sgr0),g" A.log
the whole line vanishes and when I use
sed -i "s,^%.*,$(tput setaf 1)&$(tput sgr0),g" A.log
only the first character(
%) turns red.
What should I do?
EDIT : Actually the whole line doesn't vanish, I was using
more but when I used
I saw this (with a control M character) and % in red color.
% Invalid input detected at '^' marker.^M