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
https://accounting-2.sfo3.digitaloceanspaces.com/research/accounting2-(28).html
Think oh-so-elegant luggage and fascinators that’ll complete your Mother of the Bride outfit in critical fashion.
Outstanding quest there. What happened after?
Thanks!
I have read so many articles or reviews regarding the blogger
lovers except this post is actually a nice post, keep it up.
Feel free to visit my web page … Java
https://filedn.eu/lXvDNJGJo3S0aUrNKUTnNkb/accounting4/research/accounting4-(167).html
Saks is well one of the best department stores for buying a mother-of-the-bride costume.
Awesome post.
https://filedn.eu/lXvDNJGJo3S0aUrNKUTnNkb/accounting15/research/accounting15-(180).html
They are a fantastic place to verify out if you are on the lookout for good high quality clothes.
https://accounting008.netlify.app/research/accounting008-(354)
You’ll discover understated A-line clothes and fabulous sheath numbers.
Hi there, I read your blogs on a regular basis. Your story-telling style is witty,
keep up the good work!
Hi to every body, it’s my first pay a visit of this weblog;
this blog contains remarkable and actually excellent stuff in favor of visitors.
Feel free to surf to my homepage; slot gacor
https://www.divorcefraud.org/modules/profile/userinfo.php?uid=5354021
Just wish to say your article is as surprising.
The clearness in your post is just cool and i can assume you
are an expert on this subject. Well with your permission allow me to grab your feed to keep up to date with forthcoming post.
Thanks a million and please continue the rewarding work.
Feel free to surf to my site; Leather Living Room Sets
Yes! Finally someone writes about افسردگی بعد از مهاجرت.
Wonderful beat ! I wish to apprentice while you amend your site, how can i subscribe foor a bloig web
site? The account helped me a acceptable deal. I had been tiny bit acquainted of this your broadcast provided
beight clear concept
My homepage … 카지노사이트
If sߋme one needs expert view regɑrding running a
blog then і sᥙggest him/һer tߋ go to see tһіs weblog, Keeⲣ
սⲣ the nice job.
Ηere is my blog post; sbobetmvp – Georgia –
https://filedn.eu/lXvDNJGJo3S0aUrNKUTnNkb/accounting26/research/accounting26-(301).html
For the redwood location, it might be nice to wear
something in pure colours like the two moss green outfits pictured.
https://filedn.eu/lXvDNJGJo3S0aUrNKUTnNkb/accounting24/research/accounting24-(285).html
Clean strains and a shaped waist make this a timeless and elegant mother of the bride costume
with a flattering silhouette.
https://accounting003.netlify.app/research/accounting003-(32)
A stylishly easy event gown printed with romantic florals,
perfect for the mom of the bride.
https://accounting1010.s3.us-west-004.backblazeb2.com/research/accounting1010-(48).html
Remember, you’ll look at these pictures in years to come
back.
https://accounting1005.s3.us-west-004.backblazeb2.com/research/accounting1005-(114).html
Mother of the bride dresses need not feel
frumpy or overly conservative!
1xbet
https://accounting004.netlify.app/research/accounting004-(400)
When first starting to plan your mom of the bride outfit, look to the
wedding location itself for inspiration.
I know this website gives quality depending articles and extra information, is there any other web site which offers such information in quality?
Here is my page; mid century modern couch
https://accounting24.b-cdn.net/research/accounting24-(169).html
The modern silk material glides seamlessly over your figure, but an ankle-length skirt, excessive
neckline and draped sleeves maintain issues modest.
https://accounting006.netlify.app/research/accounting006-(27)
With over 1,868 5 star evaluations and coming in well under $100, this Gatsby type Maxi gown is certain to impress.
https://accounting1014.s3.us-west-004.backblazeb2.com/research/accounting1014-(82).html
Matching your MOB costume is a fun way to show you attention to detail.
https://accounting4.research.au-syd1.upcloudobjects.com/research/accounting4-(203).html
You will want to find one thing that works in both hot and cold,
or find one thing to maintain you heat to go over it.
Hi, i feel that i noticed you visited my blog so i came to go back the favor?.I’m trying
to find things to enhance my website!I suppose its adequate to use a few of your ideas!!
https://storage.googleapis.com/catering34/research/catering34-(345).html
For a stunning look, choose a celebratory design featuring lace and long sleeves.
https://accounting-12.sgp1.digitaloceanspaces.com/research/accounting12-(160).html
Shimmering metallic tones are good for a fall or winter wedding.
https://accounting007.netlify.app/research/accounting007-(144)
Follow the styling lead and pair yours with silver sandals and a berry
lip.
Excellent beat ! I would like to apprentice
while you amend your site, how can i subscribe for a
blog site? The account helped me a acceptable deal.
I had been tiny bit acquainted of this your broadcast provided bright
clear idea
Feel free to surf to my page :: slot online
https://accounting-3.ams3.digitaloceanspaces.com/research/accounting3-(456).html
As versatile as is elegant, this icy blue frock is the perfect transition piece to take you from the
ceremony to the reception.
Wow! This blog looks exactly like my old one! It’s on a totally different topic
but it has pretty much the same page layout and design.
Outstanding choice of colors!
https://accounting2.research.au-syd1.upcloudobjects.com/research/accounting2-(134).html
Choose a timeless look, corresponding to a mermaid fishtail robe.
طلایاب
https://accounting-12.sgp1.digitaloceanspaces.com/research/accounting12-(268).html
Peach, crimson, and gold brought punchy shade to a standard
Indian sari.
This is my first time visit at here and i am truly happy to read everthing at alone place.
https://filedn.eu/lXvDNJGJo3S0aUrNKUTnNkb/accounting22/research/accounting22-(120).html
This mother chose a royal blue robe with an illusion neckline and a floral overlay for a putting big-day look.
I get pleasure from, result in I found exactly what I was taking a look for.
You have ended my four day long hunt! God Bless you man. Have a nice
day. Bye
It is the best time too mаke a few plans fоr the future annd it’s tіme to be һappy.
I have reasd tһіѕ publish aand іf I coulԀ I desire to suggеst you ffew
attention-grabbing things or tips. Ρerhaps you сould write next articles reցarding this article.
I desire to reaad eᴠеn mߋre things apprοximately it!
Taҝe а looқ at my web site: situs slot online
http://digimarketing26.s3-website.eu-south-2.amazonaws.com/research/digimarketing26-(112).html
With a delicate fit on the hips, this costume is designed to flatter you
in all the proper places.
Hey there would you mind stating which blog platform you’re working with?
I’m looking to start my own blog in the near future but I’m having a hard time choosing between BlogEngine/Wordpress/B2evolution and
Drupal. The reason I ask is because your design and style seems different then most blogs and I’m looking for something completely unique.
P.S Apologies for being off-topic but I had to ask!
Подробно расскажем, как Раздел имущества – Ленинский районный суд г. Иваново онлайн или самостоятельно. Юристы по трудовому праву подготовили пошаговую инструкцию по взысканию компенсации за задержку выплаты зарплаты в суде: этапы взыскания, размер пошлины, подсудность и ответы на частые вопросы работников
Appreciate this post. Let me try it out.
and growing proving that bdsm tgps in the bedroom
are able to receive a lot bonuses, how for your health, but and for existing relationships.
Look into my page; bdsm slave porn
I’m really impressed with your writing skills as well as with the layout on your weblog.
Is this a paid theme or did you modify it yourself? Anyway keep up the nice quality writing, it is rare to see a nice blog like this one nowadays.
my site; daftar sawer138
In the bustling city of Las Vegas, NV, finding a trustworthy plumbing
leak repair service might seem daunting. Yet, one
company stands out for its unparalleled approach to fixing leaks, making it the number
one choice for residents and businesses alike.
Boasting years of expertise, this service is adept at detecting and repairing
every kind of plumbing leaks, from minor drippy taps to complex pipe bursts.
Using the most advanced technology in leak detection, they make sure
that disruption is minimal to your property and schedule.
So, what makes them the top choice for leak repair in Las Vegas?
Firstly, their speedy service is second to none. Knowing that water damage waits
for no one, they offer around-the-clock emergency responses, making certain that assistance is
always available.
Additionally, their skilled plumbing technicians is not just trained in the latest repair
techniques but also at advising on leak prevention.
After repairing any leak, they perform a thorough examination of your plumbing system to spot any future issues, providing advice
on how to prevent them.
Their commitment to customer satisfaction is clear in every job they undertake.
From the minute you call, you’re met with understanding, respect,
and professionalism. Throughout the entire process, they ensure you’re informed, giving clear
pricing and detailed explanations of the work needed.
However, it’s not just about what we say. Countless testimonials
from satisfied customers underscore their great experiences with
the service, pointing out both the quality of workmanship but also the efficiency
and friendliness of the team members.
To sum up, if you’re facing a plumbing leak in Las Vegas, NV, turning to this top-notch
leak repair service is your best bet. Their unparalleled expertise in water pipe fix, together with their dedication to
quality, positions them as the undisputed leader in the industry.
https://filedn.eu/lXvDNJGJo3S0aUrNKUTnNkb/accounting22/research/accounting22-(142).html
This type comes in a good choice of colors from neutrals and pastels to brights.
Admiring the time and energy you put into your blog and in depth information you offer.
It’s good to come across a blog every once in a while that isn’t the same out of date rehashed information. Fantastic read!
I’ve bookmarked your site and I’m adding your RSS feeds to my Google account.
Also visit my webpage; slot gacor
Passion the site– really user friendly and great deals to see!
https://www.jawor.tv