Colourful grep on aix.
Linux implements a decent version of grep and highlights the search term using colour. Whilst AIX terminals can support colour (if your term session supports it) with escape codes I have not seen any way of making grep or egrep etc colourful.
On linux you simply add the parameter –color=auto such as
grep --color=auto SearchTerm {files}
Well as I couldn’t find anything on google I decided to implement something. And this is what I came up with. However the one bug I didn’t manage to resolve was If searching case insensitively the highlighting will only find the correct case. As sed does not support case insensitively this is a problem to solve. If nawk or gawk is installed, they do support it with the -i parameter.
#!/bin/ksh
#************************************************************************
# *
# Module Name : grepc.sh *
# Author : Dave Jarman +
# *
# Edit Record (most recent edit at top of list) *
# Date By CF Comments *
# --------- --- ---- --------------------------------------- *
# 5-Apr-12 DCJ i Use ampersand in sed search results as
# matched string to better handle regular
# expressions (thanks Zolo).
# 20-Sep-11 DCJ New file *
#************************************************************************
#
# Executes grep but with the escape codes to colourise the output.
#
# Known Bugs:
# If searching case insensitively the highlighting will only find the
# correct case. As sed does not support case insensitively this is a problem
# to solve. If nawk or gawk is installed, they do support it with the -i
# parameter.
#
# Other colours are available. Use the following lines.
# Blue echo "s/$QRY/\033[1;34m$QRY\033[0m/g" > $TMP/$$.sed
# Light blue echo "s/$QRY/\033[1;36m$QRY\033[0m/g" > $TMP/$$.sed
# Inverse blue echo "s/$QRY/\033[44;37m$QRY\033[0m/g" > $TMP/$$.sed
# Red echo "s/$QRY/\033[0;31m$QRY\033[0m/g" > $TMP/$$.sed
#************************************************************************
# Check for any options and save them
OPT=
while [[ $1 = [-+]?* ]]
do
OPT="$OPT $1"
shift
done
#
# Get the search string.
QRY=$1
shift
#
# Create a sed script to subsitiute for the appropriate colour.
# Show the search term in Blue
# echo "s/$QRY/\033[1;34m$QRY\033[0m/g" > $TMP/$$.sed
echo "s/$QRY/\033[1;34m&\033[0m/g" > $TMP/$$.sed
# echo /usr/bin/grep $OPT "$QRY" $* "|" sed -u -f $TMP/$$.sed
/usr/bin/grep $OPT "$QRY" $* | sed -f $TMP/$$.sed
#
# Clean up the tmp file *
rm $TMP/$$.sed
#
# Finish
exit 0
live wedden op snooker 2026
My site – promo sporte-wedden (https://Casacaran.com/2026/11/04/internet-gokken-kaarttelmethode/)
gokken betalen met bitcoin
Also visit my webpage – Casino kansen
When some one searches for his required thing, so he/she wants to be available that in detail, so that thing is maintained over here.
Reliable Auto repair in northport al, Northport, and Tuscaloosa County. We offer diagnostics, brake repairs, oil changes, A/C service, batteries, and pre-purchase inspections at competitive prices.
free poker sites uk, are there casinos in saskatchewan canada and
united kingdom pokies no deposit bonus, or real money online Who owns jake’s 58 casino united states
reviews
online bingo games united statesn residents, casino 2021 no
deposit uk and online casino united statesn legal real money no deposit bonus, or usa online casino no deposit
bonus codes 2021
my web page: monte carlo blackjack – Hung –
online casino mit blackjack (Jacob) uk bingo reviews, are there
casinos in saskatchewan united kingdom and real online casino australia, or
buy slot machines australia
amusementshal haarlem
Also visit my homepage … 500% Bonus casino Nederland
free fishing freuky slots, spin casino nz login and
free no deposit australia casino, or free casino chips usa
my web blog Legit Online Games Earn Real Money
online baccarat casino ideal minimum inzet 50 cent
milwaukee is langley casino open (Jasper) iowa, on line
casino canada and casino no deposit bonus codes canada 2021,
or $5 min deposit new zealandn casinos
Развлечения для взрослых доступен через гарантированные веб-сайты.
Изучите надежные платформы для получения качественного контента.
Have a look at my webpage – купить каннабис онлайн
top bingo site uk, best online casino game win – Demetria, pokies united kingdom forum and best new
casino nz, or new zealandn original slot machine download
Hi there, I enjoy reading all of your article. I wanted to write a little comment
to support you.
mobiel Wedden Voor Geld 2026 formula 1
150 free spins australia, biggest casino in ontario united kingdom and casino
in united states near detroit, or Online Casino Credit Card Deposit Malaysia (http://WWW.Coremultiprofit.Com) usa poker
web wedden golf
My web page – Virtuele online sportwedden
beste free bet blackjack casino isoftbet spellen nederland – https://www.revelationstudio.net/spelen-bij-Slots-voor-geld-door-kaarten-te-tellen/ –
Užitečný příspěvek, málokdy se vidí obsah bez zbytečné omáčky.
Sám zařizuji byt v paneláku a určitě se sem ještě vrátím.
Zdravím.
Stop by my site … M1Bar.Org
gokhal hoorn
My blog; beste live casino belgie (Rosalind)
bonus tot 75 euro beste live fan tan casino
online bingo games united statesn residents, uk slots sites and free usa cash bingo,
or united statesn online casino minimum deposit
$10
my homepage coin operated gambling machine
web csgo wedden Sites platformen
android Grote Wedden registratie (q6Newstelugu.In)
tips gratis
bitcoin gambling usa, united statesn original slot machine game and
poker tour australia, or pay by phone bill casino australia
Here is my site blackjack ko (Francisca)
beste top 10 Online wedden site
bonus kasynowy w warszawie
Feel free to visit my homepage … depozyt Blik Kasyno
gokken in bredene
Here is my blog :: 50 gratis Spins zonder storting
同性恋色情
blog topic
punto banco bonus nederland
Check out my webpage; casino app belgie bancontact
free slots australia online, best time to go to wind creek casino $10
deposit bonus new zealand and online gambling laws new zealand, or
poker sites canada
amsterdam wedden tips
Check out my page … online snooker weddenschappen [Dalton]
Premium adult platforms bieden veilige en premium inhoud voor volwassenen.
Ontdek gegarandeerde platforms voor een kwaliteitservaring.
my page :: buy male enhancement pills
Hi there! This is my first visit to your blog!
We are a collection of volunteers and starting a new project in a community in the same niche.
Your blog provided us valuable information to work on. You have done a extraordinary job!
ladbrokes slots uk, bouka pokies and free $30 pokies united states, or
new zealandn online poker alliance
Also visit my homepage; win big money casino – Zulma,
sport wedden promotiecode
Here is my blog post … e-wedden bookmaker trucs 2026
(Sophie)
keno met welkomstbonus
Look at my web site; bonus code casino paypal (Royce)
I think this is one of the most important information for me.
And i am glad reading your article. But should remark on some general things, The web site style is perfect, the articles is really great : D.
Good job, cheers
Heya i’m for the primary time here. I found this board and I in finding It really helpful & it helped
me out a lot. I am hoping to provide something again and aid others like
you aided me.
gry 100 darmowych spinów 2026 kasyno online legalne
Pretty section of content. I simply stumbled upon your site and in accession capital to assert
that I acquire actually loved account your weblog
posts. Anyway I will be subscribing to your augment or
even I fulfillment you access consistently fast.
This is my first time pay a visit at here and i am in fact happy
to read all at one place.
android online Wedden nederland op sport
Ahaa, its pleasant conversation about this post here at
this web site, I have read all that, so at this time me also commenting here.
nowe kasyno 25 zł bonus, Ruthie, btc bonus bez depozytu
Hi there, I found your site by the use of Google at
the same time as looking for a similar topic, your web
site came up, it appears to be like good. I’ve bookmarked it in my google bookmarks.
Hi there, just become alert to your weblog thru Google, and
found that it’s really informative. I’m gonna be careful for
brussels. I’ll be grateful in the event you proceed this in future.
A lot of folks will probably be benefited from your writing.
Cheers!
Hello, always i used to check web site posts here in the early hours in the morning,
for the reason that i love to gain knowledge of more and more.
Can I simply just say what a comfort to find someone that truly knows what they are talking
about on the internet. You actually know how to bring a problem to light
and make it important. A lot more people ought to read this and
understand this side of your story. It’s surprising you are not more popular because you definitely possess the gift.
Hello there! Would you mind if I share your blog with
my facebook group? There’s a lot of folks that I think would really appreciate
your content. Please let me know. Cheers
Yes! Finally something about zellige tile.