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
sportwetten anbieter österreich
Feel free to surf to my website: basketball
nba wetten tipps (https://kleintext.de/)
meest winstgevende casino site 2025
Feel free to visit my web blog :: amusementshal
heerenveen – Magda –
klassieke gokkasten lage inzet
Also visit my website boete online gokken
sports beste wedden nederland (Gilberto) online
wedden cs go
super bowl basketball live wetten strategie deutschland
I have read so many articles about the blogger lovers
except this piece of writing is really a nice
piece of writing, keep it up.
goedkoopste bitcoin betrouwbaar casino Site nederland met crypto
Thanks on your marvelous posting! I really
enjoyed reading it, you are a great author. I will make certain to bookmark your blog and will come back at some point.
I want to encourage you to ultimately continue your great work, have a nice day!
new zealandn roulette tips and tricks, is playing casino haram
(justthermostat.com) there
a casino in sydney united states and united kingdom online pokies welcome
bonus, or online real casino usa
Discover a trusted private label silver jewelry manufacturer offering wholesale silver jewelry,
custom designs, and reliable jewelry manufacturing solutions for growing brands.
poker neosurf suisse
Here is my site casino le Plus pres de paris
Beste Betalende Casino casino belgie snelle uitbetaling
klassieke gokkasten mobiel
Stop by my web site: bingo zonder registratie (Verla)
Explicit content sites offer a variety of videos for adult
entertainment. Opt for reliable platforms for a safe experience.
Visit my webpage – free porn
It’s going to be finish of mine day, except before end I am
reading this great post to increase my know-how.
free spins bonus
Take a look at my blog post casinò con paypal (http://www.planeatugranviaje.com)
top 10 wedden trucs vandaag – Numbers, sites 2026
Hello, always i used to check website posts here in the early hours in the daylight,
because i enjoy to learn more and more.
Premium pornosites bikeden premium inhod voor volwassenen.
Ontdek veilige hubs voor kwaliteit een privacy.
my website – ANALPORRkatso anaalipornoa
famous united statesn poker, uk no deposit casino and free
imatant spins no deposit bonus united states, or 5 dollar deposit Hard rock Casino lv united kingdom
Hi to every one, the contents present at this website are actually awesome for people experience,
well, keep up the nice work fellows.
casino 5 euro free bet nederland; Mitch, pakket
sequenza numeri roulette
My blog … frequenta i casinò (https://carthagosm.Com/dove-posso-giocare-a-blackjack-senza-soldi-in-italia/)
online casino aanbieders belgie
Also visit my web page :: beste vegas gokkasten
First off I want to say awesome blog! I had a quick question which I’d like to ask if you do not mind.
I was interested to know how you center yourself
and clear your mind before writing. I have had difficulty clearing my mind in getting my ideas
out. I truly do enjoy writing but it just seems like the first 10
to 15 minutes are wasted just trying to figure out how
to begin. Any ideas or hints? Appreciate it!
betrouwbare golf virtuele Wedden – franciscustotdenringen.nl, tips 2026
legaal bingo casino nederland
Also visit my site :: beste Goksite Met skrill (https://lizetdorhout.nl/)
constantly i used to read smaller content that
also clear their motive, and that is also happening with this paragraph which I am reading
at this time.
I’m gone to convey my little brother, that he should also pay a visit this weblog on regular basis to get updated from hottest news update.
euro einzahlen casino bonus
My webpage – multi wheel roulette um geld spielen (Finn)
Beste Wedden Med Promotiecode sites voor wedden
nieuwe goksite nederland met crypto
Feel free to surf to my page – casino bonus rondspelen
ile pieniędzy do kasyna
my web site; Kasyno Online Sofort
I like the helpful info you supply on your articles.
I will bookmark your blog and check once more right here regularly.
I am somewhat certain I’ll learn many new stuff proper right
here! Good luck for the next!
รู้สึกว่านี่เป็นเรื่องที่น่าสนใจ,
ขอบคุณครับ.
My homepage; THE88 แทงบอล
Tingkatkan peluang meraih keuntungan maksimal dengan bergabung di bandar togel online yang menyediakan hasil keluaran paling akurat serta layanan CS
24 jam. Dikenal luas sebagai bandar togel terpercaya,
situs bandar togel modern ini menjamin kenyamanan bermain tanpa kendala teknis maupun pemblokiran akses.
Inhoud voor volwassenen kunnen worden gestreamd op betrouwbare platforms voor privacy.
Ontdek gegarandeerde videobronnen voor kwaliteitsweergave.
Stop by my webpage – full porn movies
veilige beste wedden deposit paypal [https://Clermontferrand.Demenagements-ltds.com/2025/09/22/sportwedstrijden-wedden-bonus-2026/] website 2026
110% bonus kasyno kasyna online częstochowa [skup-aut-lublin.Pl]
2026
usa casinos that accept paypal, slot payback info united states and best
online poker sites for united kingdoms, or australian online gambling legislation
Here is my website – sphinx casino machine – Fleta,
een goede bitcoin mobiel wedden online
advies Android sportwedden
I was very happy to find this website. I wanted to thank you for ones time
due to this fantastic read!! I definitely loved every part of it and i also have you saved to fav to see new things on your blog.
micro stakes casino ervaringen
my web page; bingo betalen met creditcard (Eve)
beste sport wedden
Here is my page :: Soorten Weddenschappen
This is one of the more practical reads on colourful grep on aix I have found lately. Looking forward to more posts in this direction. For a quick look at how the data behind it is mapped, usaciv is worth bookmarking.
bingo kasyno online wpłata mastercard; Rosalind, na pieniądze
Reliable Auto repair in tuscaloosa al, Northport, and Tuscaloosa County. We offer diagnostics, brake repairs, oil changes, A/C service, batteries, and pre-purchase inspections at competitive prices.
Premier adult platforms offer secure and premium content for adults.
Discover trusted platforms for a quality experience.
my website :: ORGY PORN VIDEOS
Reliable Auto repair in tuscaloosa al, Northport, and Tuscaloosa County. We offer diagnostics, brake repairs, oil changes, A/C service, batteries, and pre-purchase inspections at competitive prices.