I use the "grep with color for lines plus the empty string" so frequently that I have a function for it:
function highlight() {
local args=( "$@" )
for (( i=0; i<${#args[@]}; i++ )); do
if [ "${args[$i]:0:1}" != "-" ]; then
args[$i]="(${args[$i]})|$"
break
fi
done
grep --color -E "${args[@]}"
}
This is only to be used as a filter, since it mangles filenames.
I'm curious, does ack support a highlight-only mode?
I'm curious, does ack support a highlight-only mode?