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
May I simply just say what a comfort to find
someone that genuinely knows what they’re talking about on the internet.
You actually know how to bring a problem to light and make it important.
More and more people need to check this out and understand
this side of the story. I was surprised that you are not more popular since you most certainly possess the gift.
Incredible! This blog looks just like my old one!
It’s on a totally different topic but it has pretty much the same layout and
design. Excellent choice of colors!
What’s up, after reading this remarkable paragraph
i am also cheerful to share my know-how here with colleagues.
Hey would you mind stating which blog platform you’re working with?
I’m going to start my own blog in the near future
but I’m having a difficult time making a decision 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 unique.
P.S Apologies for being off-topic but I had to ask!
Friends call him up Art Jeffries. To climb is something he really enjoys working on. South Dakota invariably is my home and Enjoy every day living
at this juncture. Dispatching is what she does for income but she’s already sent applications
for another one.
https://www.as7abe.com/wall/blogs/post/35010
Hi my family member! I wish to say that this article is awesome, nice written and come with approximately all significant
infos. I’d like to look more posts like this . https://b-sovety.ru/user/GXXRudolph/
Hi my family member! I wish to say that this article is
awesome, nice written and come with approximately all significant infos.
I’d like to look more posts like this . https://b-sovety.ru/user/GXXRudolph/
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.
sudadera jordan psg
If some one desires to be updated with hottest technologies then he must be go to see this web page and be up to date
every day.
My blog post – tonga whale swim tours
I am sure this piece of writing has touched all the internet visitors, its really really nice piece of writing on building up new blog.
Quality articles or reviews is the secret to attract the viewers to go to
see the web page, that’s what this website is providing.
Great blog here! Additionally your web site lots up fast!
What host are you the use of? Can I get your associate link in your host?
I desire my site loaded up as quickly as yours lol
Nice blog! Is your theme custom made or did
you download it from somewhere? A design like yours with a few simple tweeks would really
make my blog stand out. Please let me know where you got your theme.
With thanks
This is nicely expressed! .
Feel free to visit my site: https://venom77amp.com
My family members all the time say that I am killing my time here at web, except I know I am
getting knowledge daily by reading such pleasant content.
If you want when to go swimming with whales increase
your knowledge just keep visiting this web page and be updated with the most up-to-date information posted here.
Hi to all, how is everything, I think every one is getting
more from this web page, and your views are good in favor of new users.
Hi there, There’s no doubt that your site could be having web
browser compatibility issues. Whenever I take a look at your blog in Safari,
it looks fine however, when opening in Internet Explorer, it has some overlapping issues.
I simply wanted to give you a quick heads up! Other than that, fantastic site!
Also visit my page – Breathable Short Sleeve Tee
Hello there! I know this is kind of off topic but I was wondering which
blog platform are you using best time to visit french polynesia for whales this site?
I’m getting fed up of WordPress because I’ve had problems with hackers and I’m looking
at options for another platform. I would be great if you could point me in the direction of a good
platform.
hello!,I like your writing very so much!
share we keep in touch more approximately your post on AOL?
I need an expert on this house to solve my problem. May be that is you!
Looking ahead to peer you.
You’re sso interesting! I do nott think I have read throufh anything like that before.
So great to find somebody with a few unique thoughts
on this topic. Seriously.. many thanks for starting this up.
This site is one thing that is needed oon the internet,
someone with a little originality!
My bloog post; electronic component test lab
Filipinocupid Dating Site Evaluation 2022
Feel free to visit my webpage: philippines dating website
(http://Www.zgyssyw.Com)
Fantastic post however , I was wanting to know if you could write a litte more
on this subject? I’d be very grateful if you could elaborate a little bit further.
Thank you!
What a data of un-ambiguity and preserveness of valuable familiarity on the topic of unpredicted feelings.
I visited various blogs but the audio feature for audio songs present at this site is really superb.
Also visit my web page: Erotik Forum
I will right away clutch your rss feed as I can’t find your email subscription hyperlink or e-newsletter service.
Do you’ve any? Kindly let me recognise in order that I could subscribe.
Thanks.
Here is my homepage Massage Wertungen
初次接觸線上娛樂城的玩家一定對選擇哪間娛樂城有障礙,首要條件肯定是評價良好的娛樂城,其次才是哪間娛樂城優惠最誘人,娛樂城體驗金多少、娛樂城首儲一倍可以拿多少等等…本篇文章會告訴你娛樂城優惠怎麼挑,首儲該注意什麼。
娛樂城首儲該注意什麼?
當您決定好娛樂城,考慮在娛樂城進行首次存款入金時,有幾件事情需要特別注意:
合法性、安全性、評價良好:確保所選擇的娛樂城是合法且受信任的。檢查其是否擁有有效的賭博牌照,以及是否採用加密技術來保護您的個人信息和交易。
首儲優惠與流水:許多娛樂城會為首次存款提供吸引人的獎勵,但相對的流水可能也會很高。
存款入金方式:查看可用的支付選項,是否適合自己,例如:USDT、超商儲值、銀行ATM轉帳等等。
提款出金方式:瞭解最低提款限制,綁訂多少流水才可以領出。
24小時客服:最好是有24小時客服,發生問題時馬上有人可以處理。
Thank you! Valuable information!
My page – Unique and Cozy Skullies – https://www.ebay.co.uk/str/kapowukstore/CAPS/_i.html?store_cat=45660693012 –
I’ll immediately grasp your rss as I can not find your email
subscription hyperlink or newsletter service. Do you have any?
Please allow me recognise in order that I could subscribe.
Thanks.
my site; best place to see humpback whales
I really love your website.. Excellent colors &
theme. Did you develop this site yourself? Please reply back
as I’m planning to create my own website and would
like to learn where you got this from or what the theme is named.
Appreciate it!
I am really inspired together with your writing skills as neatly as with the structure to your weblog.
Is this a paid subject or did you modify it your self?
Anyway keep up the nice high quality writing, it is uncommon to see a nice weblog like this one nowadays..
That is a great tip particularly to those fresh to the blogosphere.
Brief but very accurate information… Thanks for sharing
this one. A must read post!
Check out my page; dive with whales
Excellent post. I was checking continuously this blog and I’m impressed!
Very useful information specially the last part 🙂 I care for such information much.
I was seeking this certain information for a very long time.
Thank you and good luck.
Great web site you have here.. It’s hard to find high-quality
writing like yours these days. I really appreciate people
like you! Take care!!
Feel free to surf to my blog post whale watching vacation
Your method of explaining everything in this article is genuinely good, all can effortlessly be aware of it,
Thanks a lot.
Thank you for sharing superb informations. Your website is very cool. I am impressed by the details that you have on this website. It reveals how nicely you understand this subject. Bookmarked this website page, will come back for more articles. You, my pal, ROCK! I found just the info I already searched all over the place and just could not come across. What a perfect web site.
Great delivery. Outstanding arguments. Keep up the great spirit.
Hi there Dear, are you in fact visiting this site daily,
if so afterward you will without doubt obtain pleasant experience.
I’m amazed, I must say. Rarely do I encounter a blog that’s both equally educative and amusing, and let me tell you, you’ve hit the
nail on the head. The problem is something that too few men and women are speaking intelligently about.
Now i’m very happy that I stumbled across this during my search best time to visit tahiti for whales something regarding this.
I’m nott that much ߋf a inteгnet reader to be honest but your
bbⅼogs really nicе, keep іt up! I’ll ggo aһead andd bookmark your website to come back latеr.
Cheers
Τhe other day, wһile I was at work, my cousin stole my
iρhone and tested too ѕee if it can survive a forty foot ⅾrop,
jyst so she can be a youtube sensаtion. My apple ipad is
now desstroүed and sһe hаs 83 views. I know thi is entirely off topic but I hаd to share it witrh someone!
Every weekend i used to pay a visit this site, because
i want enjoyment, as thiis this site conations actually nice funny stuff too.
Also visit my web blog … Massage Berichten
Fine way of telling, and good article to get data about my presentation subject matter, which i am going to deliver in university.
Terrific work! That is the type of information that are
supposed to be shared across the web. Shame on the seek engines for no longer positioning this publish higher!
Come on over and talk over with my web site .
Thank you =)
Hello, i feel that i noticed you visited my web site so
i came to return the choose?.I am trying to in finding issues
to improve my web site!I assume its good enough to use some of your ideas!!
Thanks for some other informative blog. Where else
may I am getting that kind of information written in such a perfect manner?
I’ve a project that I’m simply now working on, and I’ve been at the glance out for such info.
Visit my web-site whale swimming holiday
It’s very effortless to find out any matter on web as compared to books,
as I found this article at this web page.
Hello everyone, it’s my first visit at this web site, and paragraph is actually
fruitful designed for me, keep up posting such articles.