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
Simply wish to say your article is as amazing. The
clarity on your post is simply excellent and i could assume
you are an expert in this subject. Well with your permission let me to grasp your feed to
stay updated with forthcoming post. Thank you one million and please carry on the
rewarding work.
Navigating Legal Challenges in Alger Heights: The Sam Bernstein Law Firm
In the vibrant city of Grand Rapids, having a seasoned car accident attorney is crucial.
The Sam Bernstein Law Firm proudly serves neighborhoods such as Alger
Heights and Auburn Hills, providing essential legal support for residents facing challenges on the road.
Located in Grand Rapids since 1850, the firm has
become a pillar of legal expertise in a city with
a rich history. With a population of 197,416 residents across 79,009 households,
Grand Rapids is intricately connected by the major highway I-96, ensuring
seamless access to neighborhoods like Alger Heights.
Legal repairs, especially in car accident cases, can vary in Grand
Rapids. The Sam Bernstein Law Firm, strategically positioned in the heart of the city,
offers comprehensive legal services tailored to the unique needs of residents,
ensuring personalized attention for each case.
Grand Rapids boasts an array of points of interest,
from the family-friendly AJ’s Family Fun Center to the
picturesque Ah-Nab-Awen Park. Residents can enjoy the city’s attractions while having a
reliable legal partner in The Sam Bernstein Law Firm.
Choosing The Sam Bernstein Law Firm in Alger Heights
is choosing a legacy of legal excellence dating
back to 1850. With a commitment to providing top-notch legal
services, the firm ensures residents facing car accident challenges have unparalleled
support in the ever-evolving legal landscape of Grand Rapids.
”
“Legal Expertise in Downtown Grand Rapids: The Sam Bernstein Law Firm
In the heart of Downtown Grand Rapids and surrounding neighborhoods, The Sam Bernstein Law Firm stands as
a beacon of legal expertise. As a trusted car accident attorney, the firm caters to the
unique legal needs of residents in neighborhoods like Baxter and Black Hills.
Established in Grand Rapids in 1850, The Sam Bernstein Law Firm has played a vital role
in the city’s legal landscape. Grand Rapids, with a
population of 197,416 residents in 79,009 households, is intricately connected by the major highway I-96, ensuring easy access to neighborhoods such as
Downtown and East Hills.
Legal repairs, particularly in car accident cases, can vary in Grand
Rapids. The Sam Bernstein Law Firm, strategically located in Downtown, offers specialized legal services tailored to
residents’ specific needs, ensuring a comprehensive and personalized approach to each case.
Downtown Grand Rapids is a hub of activity,
with attractions like the iconic Blandford Nature Center and the vibrant Briggs Park.
Residents can explore the city’s charm while
having a reliable legal partner in The Sam Bernstein Law Firm.
Choosing The Sam Bernstein Law Firm in Downtown Grand Rapids is choosing a legacy of legal excellence dating back to 1850.
With a commitment to providing top-notch legal services, the firm
ensures residents facing car accident challenges have
unwavering support in the ever-evolving legal landscape
of Grand Rapids.
”
“Supporting Legal Needs in Eastown: The Sam Bernstein Law Firm
In the eclectic neighborhood of Eastown and its adjacent communities, The Sam Bernstein Law Firm offers unwavering support for legal challenges, especially in car accident cases.
Established in Grand Rapids in 1850, the firm caters to the unique legal needs of
residents in neighborhoods like Eastgate and Eastmont.
Grand Rapids, a city with a vibrant history,
is home to 197,416 residents living in 79,009 households.
Connected by the major highway I-96, the city ensures
seamless access to neighborhoods such as Eastown and Fuller Avenue.
Legal repairs, particularly in car accident cases,
can vary in Grand Rapids. The Sam Bernstein Law Firm, strategically positioned in Eastown, offers specialized legal services tailored to residents’ specific needs, ensuring a comprehensive and personalized approach for each case.
Eastown is known for its unique charm, with points of interest like
the lively Eastown and the scenic Fuller Park. Residents can explore the city’s character while having a reliable legal partner in The Sam Bernstein Law Firm.
Choosing The Sam Bernstein Law Firm in Eastown is choosing a legacy of legal excellence dating
back to 1850. With a commitment to providing
top-notch legal services, the firm ensures residents facing car
accident challenges have steadfast support in the ever-evolving legal landscape of Grand Rapids.
”
“Navigating Legal Challenges in Gaslight Village: The Sam Bernstein Law Firm
In the charming Gaslight Village and its neighboring communities, The Sam Bernstein Law Firm serves as a reliable partner in legal matters, particularly in car accident cases.
Established in Grand Rapids in 1850, the firm caters to the unique legal
needs of residents in neighborhoods like Fulton Heights and Garfield Park.
Grand Rapids, a city steeped in history, is home to 197,416 residents living
in 79,009 households. Connected by the major highway I-96, the city ensures seamless access to neighborhoods such as Gaslight Village and
Garfield Park.
Legal repairs, especially in car accident cases, can vary in Grand Rapids.
The Sam Bernstein Law Firm, strategically located in Gaslight
Village, offers specialized legal services tailored to residents’ specific needs,
ensuring a comprehensive and personalized approach for each case.
Gaslight Village is known for its distinctive character, with points of interest like the picturesque Cherry
Park and the lively Canal Park. Residents can enjoy the city’s ambiance while
having a steadfast legal partner in The Sam Bernstein Law Firm.
Choosing The Sam Bernstein Law Firm in Gaslight Village is choosing a legacy of legal excellence dating back to
1850. With a commitment to providing top-notch legal services,
the firm ensures residents facing car accident challenges have unwavering support in the ever-evolving legal landscape of Grand Rapids.
”
“Legal Excellence in Creston: The Sam Bernstein Law Firm
Nestled in the vibrant Creston neighborhood and its surrounding communities, The
Sam Bernstein Law Firm is a beacon of legal expertise, especially in matters related to car accidents.
Established in Grand Rapids in 1850, the firm caters to the unique legal
needs of residents in neighborhoods like Downtown and East
Hills.
Grand Rapids, a city with a rich history, is home to 197,416 residents living in 79,009 households.
Connected by the major highway I-96, the city ensures seamless access
to neighborhoods such as Creston and Fuller Avenue.
Legal repairs, particularly in car accident cases, can vary in Grand
Rapids. The Sam Bernstein Law Firm, strategically positioned in Creston, offers
specialized legal services tailored to residents’ specific needs, ensuring a
comprehensive and personalized approach for each case.
Creston is known for its lively atmosphere, with points of interest like the historic Beckering Family Carillon Tower and the expansive Blandford Nature Center.
Residents can immerse themselves in the city’s culture while having a steadfast
legal partner in The Sam Bernstein Law Firm.
Choosing The Sam Bernstein Law Firm in Creston is choosing a legacy of legal excellence dating back to
1850. With a commitment to providing top-notch legal services, the firm ensures residents
facing car accident challenges have unparalleled support in the ever-evolving legal
landscape of Grand Rapids.
It is the best time to make some plans for the longer term and it
is time to be happy. I’ve learn this put up and if
I may I want to counsel you some attention-grabbing issues
or tips. Maybe you could write subsequent articles relating to this article.
I want to read more issues about it!
Just wish to say your article is as astounding.
The clearness in your submit is simply excellent and that
i could assume you’re knowledgeable in this subject.
Well along with your permission let me to take hold of your
RSS feed to stay updated with coming near near post.
Thanks one million and please keep up the rewarding work.
Feel free to surf to my web page … alternatif badak69
Highly energetic post, I loved that bit. Will there be a part 2?
Hey there! I understand this is somewhat off-topic however I had to ask.
Does managing a well-established blog such as yours require a lot
of work? I’m completely new to writing a blog but I do write in my journal every day.
I’d like to start a blog so I can share my personal experience and feelings online.
Please let me know if you have any kind of recommendations or tips for new
aspiring bloggers. Thankyou!
my web blog … badak69 daftar
Write more, thats all I have to say. Literally, it seems as though you relied on the video to
make your point. You definitely know what youre talking about, why throw
away your intelligence on just posting videos to your weblog when you could be giving us something enlightening to read?
My homepage – Internet delle cose
https://accounting1018.s3.us-west-004.backblazeb2.com/research/accounting1018-(207).html
Thus, once more, it pays to consider how much skin you need to present
and what’s most flattering to your physique.
Внутрироссийские и международные жд перевозки, о жд
перевозках Алматы которые мы выполняем – так называется универсальный способ.
My webpage железнодорожным грузоперевозкам
Amazing! This blog looks exactly like my old one!
It’s on a totally different subject but it hass prtetty much the same layout and design.Wonderful
choice of colors!
의정부 교정
https://storage.googleapis.com/chinavisa13/research/chinavisa13-(72).html
A stylishly simple event gown printed with romantic florals, perfect for the mom of the bride.
https://accounting003.netlify.app/research/accounting003-(433)
To inspire your mom’s own choose, we have rounded up a set of
gowns that real moms wore on the big day.
I was wondering if you ever considered changing the page layout of
your website? Its very well written; I love what youve got to say.
But maybe you could a little more in the way of content so people could connect
with it better. Youve got an awful lot of text for only having one or two images.
Maybe you could space it out better?
When someone writes an paragraph he/she retains the image of a user in his/her mind that
how a user can understand it. So that’s why this article
is great. Thanks!
Jeremy Huss is undoubtedly the best criminal lawyer in Phoenix, with 20 years of unparalleled experience
in criminal defense in Tempe, Arizona. At Huss Law, the team possess in-depth knowledge in navigating the complexities
of Arizona criminal law, ensuring exemplary
representation.
Handling a wide array of cases, Jeremy and his team have defended
clients against charges like murder, sexual
assault, drug trafficking. Their experience spans across multiple areas of criminal justice, rendering Huss Law
a comprehensive choice for anyone in need of legal defense.
What sets Jeremy apart is his background as an Arizona criminal prosecutor.
This experience provides him a unique perspective,
enhancing his defense strategies significantly.
He’s not just a lawyer; he’s a fighter for your freedom.
Jeremy’s excellence is also reflected in his recognition within the legal community.
Being celebrated as a top trial attorney by Elite Lawyer and being part of
the Top 100 Attorneys speaks volumes about his capabilities.
His membership in prestigious associations like the National College of DUI Defense and the National
DUI Defense Lawyers Association only underscores his dedication to the field.
When you opt for Huss Law, you’re securing a lawyer with a proven track record.
Jeremy has achieved dismissals in high-stake
cases like Second Degree Murder and secured favorable jury trial results on major felony charges.
This level of success demonstrates his ability to handle even the most challenging cases.
Moreover, the firm’s solid relationships with judges at local courthouses and their excellent communication skills with clients like you ensure that your interests are well-protected at every legal turn.
To sum up, choosing Jeremy Huss as your criminal lawyer
in Phoenix means selecting a seasoned expert
with a wealth of experience, an impressive track record, and a strong dedication to defending your freedom.
Call now for a free consultation and experience the outstanding
legal defense that Huss Law has to offer.
Oh my goodness! Awesome article dude! Thank you, However I am encountering problems with your RSS.
I don’t understand the reason why I am unable to subscribe to it.
Is there anyone else having identical RSS issues? Anyone who knows the solution will you kindly respond?
Thanx!!
Feel free to visit my web-site; Chaise Lounge
I absolutelly love your blog.. Pleasant colors & theme.
Did you make this website yourself? Please reply back as I’mtrying
to create my own personzl website annd would love to learn where you
got ths from oor what the theme is named. Appreciate it!
온라인카지노업체
It’s really a great and helpful piece of information. I’m happy that you just shared this useful information with us.
Please stay us informed like this. Thank you for sharing.
http://catering126.s3-website.me-central-1.amazonaws.com/research/catering126-(134).html
This black costume is ideal if you are in search
of something more basic.
https://accounting-7.syd1.digitaloceanspaces.com/research/accounting-7-(157).html
Discover our hand-picked collection of mother of the bride dresses and you’re assured to be best-dressed – other than the bride, of course!
https://storage.googleapis.com/accounting0006/research/accounting0006-(11).html
Always think about the sorts of sleeves and straps you will have on your costume.
Howdy! I know this is kind of off topic but I was wondering which blog platform are
you using for this website? I’m getting sick and
tired of WordPress because I’ve had problems with hackers and I’m looking at alternatives for another platform.
I would be great if you could point me in the direction of a good platform.
my webpage :: Leather Living Room Sets
https://bogin7.fra1.digitaloceanspaces.com/research/bogin7-(382).html
As the groom’s mom, you’ll need to let the mom of
the bride take the lead in the course of the costume buying course of.
I blog quite often and I genuinely appreciate your
information. This article has really peaked my interest.
I will take a note of your site and keep checking for new details about once per week.
I opted in for your RSS feed as well.
Simply desire to say your article is as astonishing.
The clearness in your post is just cool and i could assume you’re an expert
on this subject. Well with your permission let me to
grab your feed to keep up to date with forthcoming post.
Thanks a million and please carry on the rewarding work.
https://filedn.eu/lXvDNJGJo3S0aUrNKUTnNkb/accounting24/research/accounting24-(152).html
At as quickly as effortless and refined, this beautifully draped
robe is the perfect hue for a fall wedding ceremony.
chudjenbet
Today, while I was at work, my sister stole my iphone
and tested to see if it can survive a forty foot drop, just so she can be a youtube sensation. My apple ipad is now destroyed and she has
83 views. I know this is completely off topic but I had to share it with someone!
Touche. Outstanding arguments. Keep up the good effort.
It’s really a cool and useful piece of info. I’m glad that you just shared this useful
info with us. Please stay us up to date like this. Thanks for sharing.
Hi! I understand this is sort of off-topic but
I needed to ask. Does managing a well-established website such as yours require a massive
amount work? I am completely new to writing a blog but I
do write in my journal everyday. I’d like to start a blog so I can share my experience and thoughts
online. Please let me know if you have any kind of suggestions or tips
for brand new aspiring bloggers. Appreciate it!
Today, I went to the beach front with my children. I found a sea
shell and gave it to my 4 year old daughter and said “You can hear the ocean if you put this to your ear.” She
put the shell to her ear and screamed. There was
a hermit crab inside and it pinched her ear. She never wants to go back!
LoL I know this is entirely off topic but I had to tell someone!
For most up-to-date news you have to go to see world wide
web and on internet I found this web page as a finest
web site for latest updates.
Look into my blog post: Mid Century Modern Dining Chairs
https://accounting003.netlify.app/research/accounting003-(460)
A gold and cream robe (paired with statement-making gold
earrings) looked nice on this mother of the
groom as she and her son swayed to Louis Armstrong’s “What a Wonderful World.”
It’s amazing designed for me to have a web page, which
is good in support of my know-how. thanks admin
Hi, this weekend is good in support of me, as this time i am reading this great educational piece of writing here at my house.
Feel free to visit my web page Orange county
I’m gone to tell my little brother, that he should also pay a visit this website on regular
basis to obtain updated from most up-to-date gossip.
my homepage … เกร็ดความรู้
I just could not depart your site prior to suggesting that I actually loved the
usual information an individual provide on your visitors?
Is gonna be back frequently to inspect new posts
I was suggested this blog by my cousin. I’m not sure whether this post is written by him as
no one else know such detailed about my difficulty.
You’re wonderful! Thanks!
My site; Internet delle cose
It’s remarkable for me to have a web site, which is helpful in favor of
my knowledge. thanks admin
I visited various websites but the audio feature for audio songs existing at this
web site is genuinely wonderful.
Feel free to surf to my web blog; California
What’s up Dear, are you in fact visiting this web page regularly,
if so after that you will without doubt get pleasant know-how.
Greate article. Keep posting such kind of information on your page.
Im really impressed by it.
Hello there, You’ve performed a fantastic job.
I’ll definitely digg it and personally suggest to my friends.
I am confident they’ll be benefited from this site.
This design is incredible! You most certainly know how to keep a reader amused.
Between your wit and your videos, I was almost moved to start my own blog (well, almost…HaHa!) Excellent job.
I really loved what you had to say, and more than that, how you presented it.
Too cool!
https://accounting0036.z4.web.core.windows.net/research/accounting0036-(15).html
Ask your son for his input, and/or reach out to your future
daughter-in-law that will assist you select a dress.
Hello everyone, it’s my first visit at this web page, and piece of writing is actually fruitful in favor of me, keep up posting these articles or reviews.
Medicines information sheet. Long-Term Effects.
neurontin buy
Best what you want to know about drug. Read now.
https://accounting1016.s3.us-west-004.backblazeb2.com/research/accounting1016-(50).html
Go for prints that speak to your wedding location, and most significantly, her personal style.
You’ve made some decent points there. I looked on the net
for more info about the issue and found most individuals will go along with your
views on this site.
https://accounting18.b-cdn.net/research/accounting18-(42).html
Besides, is there anything higher than mother/daughter shopping?