❦ 7 March 2022 18:33 +01, Adam Borowski: >> lumin highlights matches to a specified pattern (string or regular >> expression) in files, using color. This is similar to grep with >> colorized output, but it outputs all lines in the given files, not >> only matching lines. > > .--====[ ~/bin/hl ] > #!/bin/sh > sed 's/'"$*"'/\c[[1;33m&\c[[0m/g' > `----
grep --color -C400000000000 pattern There are other suggestions here: https://stackoverflow.com/questions/981601/colorized-grep-viewing-the-entire-file-with-highlighted-matches -- Let the data structure the program. - The Elements of Programming Style (Kernighan & Plauger)