Highlight matched pattern upon string
I would like to have a bash function that highlights a matched pattern upon a string.
Code:
cregex () But the function in not behaving as I would wish. For instance Code:
cregex "tput" "tput bold; tput setaf 39" |
grep --color tput <<<'erfa tput f r tput tput adf'
|
Would this allow a user to specify any pattern and any text, so that the matched text is highlighted? Would the use of "<<<" redirection suffer from code injection vulnerabilities?
|
All times are GMT -5. The time now is 12:48 PM. |