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
I all the time used to read paragraph in news papers
but now as I am a user of net therefore from now I am using net for articles, thanks to
web. https://www.ipsorgu.com/site_ip_adresi_sorgulama.php?site=https://goelancer.com/question/salon-de-coiffure-montreal-coiffure-fermer-de-chez-vous-aussi/
Hi there it’s me, I am also visiting this web site regularly, this website is genuinely nice and the visitors are genuinely sharing pleasant
thoughts.
beste casino texel
met loyalty programma
automaty 3d kasyno online – Lesley – online od 20 euro
sloty online litecoin
my homepage … live baccarat z polskim krupierem (Timothy)
meest populaire bitcoin casino belgie
Also visit my web-site – 80 ball bingo hoge inzet (http://WWW.Salelles.cat)
kasyno online lublin bonus minimalna wpłata
1 zł
najlepsze Kasyno Btc tether
opinie
depozyt blik kasyno paysafecard wpłata od 1 zł
After checking out a few of the blog posts on your
website, I really like your technique of blogging. I bookmarked it to my bookmark webpage list and will be checking back in the near
future. Please visit my website too and tell me what
you think.
What’s up, I log on to your blog daily. Your story-telling
style is witty, keep doing what you’re doing!
Superb blog you have here but I was wanting to know
if you knew of any community forums that cover the same topics discussed here?
I’d really like to be a part of community where I can get advice from other
knowledgeable people that share the same interest. If you have any suggestions,
please let me know. Appreciate it!
Right here is the right webpage for anyone who would like to understand this
topic. You understand a whole lot its almost tough to argue with you (not that I personally would want to…HaHa).
You definitely put a new spin on a subject that has been discussed for decades.
Wonderful stuff, just wonderful!
色情内容 可在各种成人娱乐网站上获取,供娱乐用途。始终选择 可靠的成人网站 以确保安全体验。
My page :: 网上买安定药
nowe kasyno online nowe 2026, Kelle, 175% bonus od depozytu
kasyno online app
My page Bonus na sloty
It’s a pity you don’t have a donate button! I’d most certainly donate to this
fantastic blog! I guess for now i’ll settle for bookmarking and adding your RSS feed to my Google account.
I look forward to new updates and will share this site with my Facebook
group. Talk soon!
Wow! After all I got a webpage from where I can in fact
take valuable facts concerning my study and knowledge.
kasyno apk blik
Also visit my web-site :: lightning ruletka od 10 zł
bonus kasynowy w polsce
Here is my webpage: legalne kasyno online dolnośląskie (https://Estrellasdreamspa.com)
beste fa cup wettanbieter
Visit my site – wetten basketball pro a (Tyson)
50 euro bonus Kasyno Minimalna wpłAta 1 euro online
500 zł darmowe kasyno białystok paysafecard
FloraJapan — Delivering happiness, flower-by-flower. Whether you’re celebrating a
birthday, an anniversary, or just want to show you care, flowers are an appropriate way to connect with your loved ones throughout Japan. Our carefully curated bouquets are
perfectly crafted to convey what your heart truly feels.
pago ruleta Edad Para Ir Al Casino
Hey There. I discovered your weblog using msn. That is an extremely
well written article. I’ll make sure to bookmark it and return to learn more
of your useful info. Thanks for the post. I will certainly return.
sportwetten interwetten
Also visit my page: Basketball Wett Tipps Forum
Kasyna offshore dla polaków online łódź
mejores tips que es over en las apuestas deportivas
However, making some unexpected or surprising remarks at a correct
time may help a lot in attracting and impressing your best lady.
Feb 6, 2022: I haven’t felt like writing a long blog post for the
post couple of weeks.
Kasyno Platnosc Skrill katowice legalne
%u
Magnificent beat ! I wish to apprentice while you amend your website, how can i subscribe for a blog website? The account aided me a acceptable deal. I had been a little bit acquainted of this your broadcast offered bright clear concepthttp://www.www.envylook.com/member/login.html?noMemberOrder=&returnUrl=https://ste-b2b.agency/
Here is my blog post … promotion hack sims 4 2027/2028
Найдите контент для взрослых, исследуя надежные платформы
в Интернете. Изучите защищенные источники контента для приватного просмотра.
Look into my web-site :: продаются таблетки валиума
site-uri poker legale romania
my web-site – aplicatie casino cu rotiri Gratuite (https://www.grupomanservice.com/)
paypal casas de mejores apuestas combinadas para hoy (Alissa)
cele mai bune cazinouri dogecoin
Also visit my web blog – păcănele cu bitcoin
oferta casas casa de Apuestas deposito minimo apuestas
online sportwetten anbieter
My webpage :: basketball wett tipps Forum
Hi, Neat post. There’s an issue with your site
in internet explorer, would test this? IE still is the
market leader and a good part of people will pass over your
excellent writing because of this problem.
Pretty section of content. I just stumbled upon your weblog and in accession capital to assert that I acquire
actually enjoyed account your blog posts. Anyway I’ll be subscribing
to your augment and even I achievement you access consistently
quickly.
It is generally not recommended to take ephedrine
and Viagra together without consulting a healthcare professional.
perfekte wettstrategie
my web blog: Wett Tipps Basketball
When some one searches for his vital thing, so he/she wants to be available that in detail, so that
thing is maintained over here.
Hurrah, that’s what I was looking for, what a material!
present here at this webpage, thanks admin of this web
site.
Explore the ease of buy Adderall online without prescrition Adderall Online Without Prescription, your
trusted source for accessible solutions! Shop a modern platform offering premium Adderall, crafted to boost your energy.
Whether you’re tackling personal challenges or aiming for clarity, our fast service delivers confidentially with complete
privacy. Visit for instant access to verified products, fueling your needs anytime.
Why settle when you can simplify your routine with Buy Adderall Online Without Prescription? Our vast inventory connects you to safe products at competitive prices, with rapid delivery to meet your demands.
Browse with assurance on our sleek platform, updated daily
to ensure reliable stock. No delays—just secure access to the support you need.
Order now and redefine your experience today!
mejor casa de que significa over en las Apuestas (https://www.tallpaulmarketing.com/) online
wetten tipps basketball spiele
kasyna sloty online visa olsztyn
kasyno z depozytem 5 euro [Toney] najmniejszy
depozyt
Hi there! This blog post could not be written much better!
Reading through this article reminds me of my previous roommate!
He continually kept preaching about this. I most certainly
will send this information to him. Pretty sure he will
have a great read. I appreciate you for sharing!