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
Have you ever considered about including a little bit more than just
your articles? I mean, what you say is fundamental and everything.
Nevertheless think about if you added some great pictures or
videos to give your posts more, “pop”! Your content is excellent but with
images and clips, this website could undeniably
be one of the best in its niche. Very good blog!
You can certainly see your enthusiasm in the article you write.
The world hopes for even more passionate writers like you
who are not afraid to mention how they believe.
All the time go after your heart.
https://myportal.utt.edu.tt/ICS/_portletview_/Campus_Life/Campus_Groups/Safer/Discussion.jnz?portlet=Forums&screen=PostView&screenType=change&id=ac729349-4886-4c10-bf95-c188fc977035
You’re so awesome! I do not believe I’ve read anything like
this before. So nice to find another person with a few genuine
thoughts on this subject. Seriously.. thank you for starting this up.
This site is one thing that’s needed on the web, someone
with a little originality!
I think this is among the most significant information for me.
And i am glad reading your article. But want to remark
on some general things, The site style is wonderful, the articles
is really great : D. Good job, cheers
I absolutely love your blog and find nearly all of your post’s to
be exactly I’m looking for. can you offer guest writers to write content to suit your needs?
I wouldn’t mind creating a post or elaborating on a lot of the subjects you write about
here. Again, awesome blog!
I don’t even know the way I stopped up right here,
but I believed this publish used to be great. I do not know who you might be but certainly you are
going to a well-known blogger when you are not already. Cheers!
Good way of explaining, and fastidious piece of writing to
get data concerning my presentation subject, which i am going to convey in college.
Feel free to visit my web-site Massage bbs
Mʏ partner and I stumbled oѵeг herе different website and thоught I miɡht as ᴡell check thіngs out.
I like ԝhat I see so now і am fоllowing yօu.
Look forward to lօoking ⲟver yoᥙr web paɡe yet аgain.
Aⅼs᧐ visit my webpage … sbopower, http://sbopower.Com/,
Good day! Do you know if they make any plugins to
safeguard against hackers? I’m kinda paranoid about losing everything I’ve worked hard on. Any recommendations?
Good day! I could have sworn I’ve been to this site before but after reading through
some of the post I realized it’s new to me. Anyhow, I’m definitely glad I found it and I’ll be book-marking and checking back often!
Choice Crusader for Smart Shoppers
Link exchange is nothing else however it is just placing the
other person’s blog link on your page at appropriate
place and other person will also do similar in support of you.
https://www.mses-expert.ru/
Excellent way of explaining, and nice post to get data concerning my presentation subject matter, which i
am going to convey in academy.
My brother recommended I would possibly like this website.
He was totally right. This submit truly made my
day. You can not believe just how much time I had spent for this information! Thank you!
I am really impressed with your writing skills
as well as with the layout on your blog. Is this a paid theme or did you customize it yourself?
Either way keep up the nice quality writing,
it’s rare to see a great blog like this one these days.
This information is worth everyone’s attention. Where can I find out more? https://Socialmarkz.com/story6770105/massoth%C3%A9rapie-%C3%A0-st-jean-sur-richelieu
This information is worth everyone’s attention. Where can I find
out more? https://Socialmarkz.com/story6770105/massoth%C3%A9rapie-%C3%A0-st-jean-sur-richelieu
Hmm it seems like your site ate my first comment (it
was extremely long) so I guess I’ll just sum it up what I had written and say,
I’m thoroughly enjoying your blog. I as well am an aspiring blog writer
but I’m still new to the whole thing. Do you have any
tips and hints for novice blog writers? I’d genuinely appreciate it.
Look into my webpage: Massage Forum
I’m now not positive the place you are getting your
info, but great topic. I needs to spend some time learning
much more or figuring out more. Thanks for excellent information I was in search of this information for my mission.
Thanks for sharing your thoughts on center for
immigration studies. Regards
This piece of writing offers clear idea for the new users of blogging, that actually how to do
blogging and site-building.
Stop by my page; whale watching holidays
I will immediately grab your rss feed as I can’t to find your e-mail subscription link or e-newsletter service.
Do you have any? Please permit me recognize in order that I could subscribe.
Thanks.
Thanks for every other informative web site.
The place else could I am getting that kind of info written in such an ideal
approach? I’ve a mission that I am just now working on,
and I’ve been at the look out for such information.
Keep on working, great job!
Also visit my webpage – whale swimming vacation
I every time used to study article in news papers but now as I am a user of internet therefore from now
I am using net for content, thanks to web.
These are in fact fantastic ideas in regarding blogging.
You have touched some pleasant points here. Any way keep up wrinting.
Highlү descriptіve post, I liked thаt a lot. Will there be a pаrt 2?
If you are going for finest contents like I do, simply pay
a quick visit this web site all the time for the reason that it provides quality contents, thanks
If yߋu wish for to get mucһ from thiѕ paragraph tһen you have to apply such techniques to your won websіte.
Every weekend i used to visit this web page, because i
want enjoyment, for the reason that this this web page
conations truly good funny data too.
It’s ɑn awesome piece of writing in favor of all the internet users; they will obtain benefit from it I ɑam sure.
Hello, Neat post. There’s an issue together with your
website in internet explorer, may check this? IE nonetheless is the marketplace leader and a huge part of folks will leave
out your excellent writing because of this
problem.
At this time it seems like Drupal is the top blogging platform available right now.
(from what I’ve read) Is that what you’re
using on your blog?
What’s up, this weekend is pleasant in favor of me, as
this time i am reading this impressive informative piece
of writing here at my home.
I was able to find good advice from your content.
My brother suggested I might like this web site.
He was entirely right. This publish actually made
my day. You cann’t imagine just how so much time I had spent for this info!
Thank you!
Also visit my web blog … swim with humpback whales tahiti
Enhance Your Workspace with Freedman’s Office Chairs in Fort Lauderdale
**Experience Unmatched Comfort with Freedman’s Ergonomic Office Chairs**
Freedman’s Office Furniture, situated at 515 E Las Olas
Blvd Suite 120, Fort Lauderdale, FL 33301, brings you a premium selection of
ergonomic office chairs designed to elevate your comfort and
productivity. Serving neighborhoods like Colee Hammock and Central Beach, Freedman’s is
committed to providing top-notch seating solutions for your workplace.
**Embracing Comfort and Style in Fort Lauderdale**
Founded in 1911, Fort Lauderdale boasts a rich history
and a population of 181,668 as of 2021. With 80,031 households, the city thrives as a hub of business and leisure.
Connected by the bustling I-75 highway, Fort Lauderdale is a vibrant city known for its
stunning beaches and diverse cultural scene.
**Seating Solutions Tailored to Fort Lauderdale’s Dynamic Environment**
Just like Fort Lauderdale’s varied landscape, Freedman’s ergonomic office chairs offer versatility and adaptability.
Whether you’re working in the bustling streets of Central Fort Lauderdale or the serene neighborhoods of Beverly
Heights, our chairs provide the perfect blend of support and style to
complement your workspace.
**Affordable Repairs and Climate-Adaptive Office Chairs**
Freedman’s understands the importance of a comfortable workspace.
That’s why we offer affordable repair services for our ergonomic office chairs in Fort Lauderdale.
Crafted to withstand the city’s varying temperatures, our chairs ensure
year-round comfort and support for all your professional endeavors.
**Exploring Fort Lauderdale’s Unique Points of Interest**
Discover the charm of Fort Lauderdale with these notable attractions:
– **Anglin’s Fishing Pier:** A historic landmark offering scenic views and excellent fishing opportunities.
– **Bonnet House Museum & Gardens:** Immerse yourself
in art, history, and nature at this exquisite estate.
– **Dr. Von D. Mizell-Eula Johnson State Park:** Explore
mangrove swamps, beaches, and hiking trails in this coastal paradise.
– **El Prado Park:** A serene green space perfect for picnics and outdoor relaxation.
– **Esplanade Park:** Enjoy events and concerts in this lively park along the New
River.
**Why Choose Freedman’s for Your Office Furniture Needs in Fort Lauderdale**
Opting for Freedman’s ergonomic office chairs means choosing unparalleled comfort, innovative design, and durability tailored to
Fort Lauderdale’s dynamic environment. Upgrade your workspace with Freedman’s, where each chair represents the perfect balance of support, style, and functionality, ensuring a productive and comfortable
workday in Fort Lauderdale.
https://www.mses-expert.ru/
cetkicom canada pharmacy discount center dictatures best canada pharmacy https://canadapharmacy-usa.com/ – canada pharmacy online order [url=https://canadapharmacy-usa.com]ivermectin online canada pharmacy[/url] tandas canada pharmacy usa
I love your blog.. very nice colors & theme. Did you
create this website yourself or did you hire someone to do it for you?
Plz answer back as I’m looking to design my own blog and would like
to know where u got this from. thanks
Here is my site whale swimming in tonga
I am really enjoying the theme/design of your
weblog. Do you ever run into any browser compatibility issues?
A small number of my blog readers have complained about my site not working correctly in Explorer but looks great in Opera.
Do you have any suggestions to help fix this problem?
Hi there! I understand this is sort of off-topic but I
had to ask. Does managing a well-established website such as
yours require a massive amount work? I am brand new to operating a blog but I do write in my diary 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 new aspiring bloggers.
Appreciate it!
I’m gone to tell my little brother, that he should also pay a visit this webpage on regular basis to take updated from most recent information.
beautiful HD porn
I love your blog.. very nice colors & theme.
Did you design this website yourself or did you hire someone to
do it for you? Plz respond as I’m looking to design my own blog and would like to find
out where u got this from. thanks
My site whale watching vacation
I used to be able to find good info from your content.
When some one searches for his necessary thing, therefore
he/she desires to be available that in detail, so that thing is maintained
over here.
If you are going for best contents like me, just pay a quick
visit this web page everyday because it presents quality contents, thanks