You are not logged in.
I'm looknig for a tool which can be used in terminal for highlighting patterns. For example
$ cat fruits
banana
apple
orange
$ cat fruits | hilight_magic_tool apple
banana
apple # <-- highlightetd
orange
$ cat fruits | hilight_magic_tool strawberry
banana
apple
orange
Its quite similiar to grep --color=auto but grep shows only output when the pattern occurs, when the pattern doesn't occur it acts like simple cat.
Anybody knows the real name of the hilight_magic_tool?
If a man does not know to what port he is sailing, no wind is favourable
- Seneca
Offline
Make a sed script:
#!/bin/dash
sed -e 's/'"$1"'/^[[31m&^[[m/g'
The ^[[ is made by CTRL+v, ESC, [
EDIT: added double quotes around $1 to make more possible.
Last edited by Procyon (2008-07-08 11:19:26)
Offline
Great It works perfectly!!! Thanks a lot!!!
Stupid me, forget about sed
If a man does not know to what port he is sailing, no wind is favourable
- Seneca
Offline
grep --color=auto
Offline
use "less" and search inside it.
Offline