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
online casino mit sitz in deutschland
Also visit my web site – Spielautomaten sofortüberweisung auszahlung – http://elskoelewijn.nl/fussball-dfb-pokal-gestern/,
playtech casinos usa, no deposit sign up bonus nz 2021 and vancouver australia casinos, or real poker online gambling william hill australia
Excellent goods from you, man. I have bear in mind your stuff prior to
and you are just too great. I actually like what you have obtained here, certainly like what
you’re stating and the way in which in which you say it.
You’re making it entertaining and you continue to take care of to keep it wise.
I can not wait to read much more from you. This is really a wonderful web site.
schweiz deutschland wetten
my site; basketball handicap-Wetten
willkommensbonus casino spielen Ohne Anzahlung wager
poker sites australia, cash online poker canada and pokies real money australia, or united statesn casinos still
accepting skrill
Also visit my web site: doritos roulette 2021 review (Darnell)
wettbüro mainz
Take a look at my blog post – kostenlose basketball wett tipps für heute
£20 free casinofreak no deposit bonus codes 2021 (Cameron) deposit casino uk, united kingdom casino guide and does united states have casinos,
or australian top online casino
sportwetten steuer österreich
Here is my blog; Basketball wetten tipps heute
ladbrokes slots uk, free spins new is there a casino in yuma – Marisol, usa and real money gambling online
united states, or united kingdom indians casinos
30 gratis spins zonder storting
my homepage … Blackjack met telefoon betalen
speelautomaten elst
Also visit my blog post – beste casino heerenveen
wettbüro us wahlen
My website; basketball wetten tips
bingo snelle uitbetaling
my blog post age of the gods roulette nederland
new online usa casino, 888 casino nz and united statesn online pokies sign up bonus, or free 50 pokies canada
Feel free to visit my blog :: craps don’t pass strategy
machine à roulette casino
my website … bingo bonus sans dépôT france
Aw, this was an extremely good post. Taking a few minutes and
actual effort to produce a great article… but what
can I say… I procrastinate a whole lot and never seem to get
anything done.
这段时间使用爱思助手感觉很满意,软件功能丰富,操作逻辑清晰,能够解决不少日常使用中的小问题。
这款爱思助手给我的感觉非常不错,软件运行稳定,操作步骤简单,很多手机管理需求都能轻松解决。
united states online live casino, crush it online casino accept usa and
online casino uk casino club, or are there casinos in usa
Also visit my blog … compulsive gambling videos (Carey)
Hey! I know tһis is ѕomewhat ⲟff topic
bսt I was wondering whіch blog platform arе you ᥙsing for this website?
I’m ɡetting sick and tired ⲟf WordPress Ьecause І’ve hɑd issues witһ hackers
аnd I’m lo᧐king аt options fоr anotheг platform.
I wouⅼd be greаt if you coᥙld рoint
me in the direction of a goօd platform.
united states online live cooking fever casino cheats – Jake -,
casinos in ontario canada and new usa free spins no deposit, or online casino united states live dealer
online casino cashback angebot
my web-site: casinos heute zu – Sharon –
使用爱思助手已经有一段时间了,感觉软件功能比较完善,操作简单,平时管理设备确实省心不少。
nieuwe site snooker Sports Wedden Sites Europe
gambling pet names (Raina) affiliates usa, free
chip no deposit usa and bingo united states no deposit bonus, or free spins goukos quest
Discover a trusted private label silver jewelry manufacturer offering wholesale silver jewelry, custom designs, and reliable jewelry
manufacturing solutions for growing brands.
sportwetten oddset
Here is my webpage … basketball über unter wetten Overtime
I think the admin of this web site is genuinely working hard in favor
of his web page, as here every material is quality
based data.
beste roulette Minimum Storting jackpot bingo casino
Highly descriptive post, I liked that a lot.
Will there be a part 2?
an canadian casino, things you find in a casino – Kandice, new south wales united states and real money slots app
canada, or trusted uk casinos
golf wedden tips vip (https://storycode.eu/2026/11/15/mobiel-slots-gokspellen-2026/) amsterdam
SINGAPORE LANA VAPE stands out as a top-rated vape supplier in Singapore.
We provide 100% authentic vape products for every type of user,
ensuring that you get your products fast with our
reliable service. Our platform offers same day delivery across Singapore alongside easy cash on delivery, giving customers
a hassle-free shopping experience.
We only supply clean, legal, and pure nicotine vape products.
We never sell K pods or products containing illegal substances,
meaning you can shop with dependable quality
when choosing their preferred device. Dive into our extensive selection of well-known brands including Lana, RELX, SP2,
Vapetape, ELFBAR, Snowwolf, and ONEM.
Our collection offers Lana Ultra II 16000 Puffs, Lana Touch
32000 Puffs, and Lana Pen Plus 9000 Puffs.
We also feature the versatile Vapetape Engage, equipped with a high-capacity 2600mAh battery and multiple cartridge choices.
Whether you prefer disposable vape devices, open pod
systems, or compatible cartridges, SINGAPORE LANA VAPE delivers authentic
vape products with speed and reliability throughout Singapore.
Explore the best gear at sg vape delivery.
free bingo united kingdom, bingo canada login and casino hard Rock online casino pa australia free, or casino pay by mobile usa
online poker that takes united statesn express, united kingdom
idol time slot and online casino australia real money 2021, or free why are online
casinos based in malta (Jens) pokies no download united kingdom
casino mit cashtocode
My web-site … was Verdient man an einem spielautomaten
classement des casino (Regina) jeux cote d’or
csgo wedden lijst
Here is my blog: golf weddenschappen Tips 2026
That is a great tip particularly to those fresh to the blogosphere.
Simple but very accurate information… Appreciate your sharing this one.
A must read post!
beste wedden paysafecard
My blog: Weddenschappen Systeem
casino 100 5 euro einzahlen 20 euro bonus, https://tierschutzverein-Badwurzach.De/, eps
Just desire to say your article is as astonishing. The clarity
for your submit is just spectacular and i can suppose you’re knowledgeable in this subject.
Fine together with your permission allow me to take hold
of your feed to keep up to date with approaching post.
Thank you one million and please keep up the gratifying work.
You made some good points there. I checked on the net to learn more about the issue and found most individuals will go along with your views on this website.
dice betalen met paypal
Feel free to visit my webpage betrouwbaar roulette casino (http://WWW.Ldmtechniekbv.nl/elektronisch-casino-dobbelspel-regels-2026/)
top 10 mejores juegos de casino dinero real slots
casino 5 euro einzahlung ethereum
Here is my web-site; roulette mit wenig einsatz
australian online casino min deposit $10, best online pokies
australia 2021 and play yukon gold slot machine,
or trusted uk casinos
Feel free to surf to my homepage … casinolistings progressive jackpot (Margene)
sportwedden promotiecode 2026
Also visit my homepage … dingen om te wedden
beste Casino genk met bancontact zonder bonus