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
Great work! This is the type of info that are meant to be
shared across the internet. Disgrace on Google for no longer positioning this submit
higher! Come on over and consult with my site .
Thanks =)
Also visit my homepage – Buy HCG Injections Online
Way cool! Some extremely valid points! I appreciate you penning this write-up and the rest of the website is very good.
Hi аll, herе every one is sharing such know-һow, thus it’s good to read this website,
and I used to visit this weblog everyday.
https://chinavisa51.z16.web.core.windows.net/research/chinavisa51-(51).html
As a mom, watching your son or daughter get married will be one
of the most joyful experiences in your life.
Elevate Your Digital Presence with Digitaleer in Phoenix
**Empowering Your Online Success in Phoenix**
When it comes to navigating the digital landscape
in Phoenix, Digitaleer stands out as a premier digital
marketing agency. Situated at 310 S 4th St #652, Phoenix, Arizona 85004, our team offers a comprehensive suite of online marketing services tailored to
meet the unique needs of businesses in neighborhoods like Adobe Highlands and
Arizona Hillcrest. From SEO optimization to social
media management, we specialize in enhancing your digital presence
and driving measurable results.
**Exploring the Vibrant City of Phoenix**
Phoenix, founded in 1867, is a thriving metropolis nestled in the
heart of the Sonoran Desert. With a population of 1.625 million and over 591,169 households, it’s one of
the fastest-growing cities in the United States. Interstate 10, a major highway that spans
the country, serves as a vital artery connecting Phoenix to neighboring cities and
states.
**Cost of Digital Solutions and Climate in Phoenix**
Digital solutions in Phoenix can vary depending on the scope and complexity of the project.
On average, businesses may invest anywhere from $1,000 to $10,000
or more for comprehensive digital marketing services.
As for the climate, Phoenix experiences a hot desert climate with
scorching summers reaching highs of 110°F (43°C) and mild winters with temperatures
averaging around 60°F (16°C).
**Discovering Phoenix’s Top Points of Interest**
Explore these must-visit attractions in Phoenix:
– **Arizona Boardwalk:** An entertainment district featuring restaurants,
shops, and attractions like the OdySea Aquarium.
– **Arizona Capitol Museum:** Learn about Arizona’s rich history and political heritage
at this captivating museum.
– **Arizona Falls:** A scenic waterfall and hydroelectric plant nestled in the
heart of the city.
– **Arizona Science Center:** A hands-on science museum with
interactive exhibits and educational programs for all ages.
– **Butterfly Wonderland:** Immerse yourself in the enchanting world
of butterflies at North America’s largest butterfly conservatory.
**Why Choose Digitaleer for Your Digital Marketing Needs**
Choosing Digitaleer means partnering with a trusted ally dedicated to
your online success. With our expertise in SEO optimization, web
development, and digital advertising, we help businesses in Phoenix stand out
in a competitive digital landscape. Whether
you’re looking to increase brand visibility, drive website traffic, or
boost conversions, Digitaleer delivers tailored solutions that drive real results and help you achieve
your business goals.
https://chinavisa52.z1.web.core.windows.net/research/chinavisa52-(407).html
Our moms are beautiful and superb and they want to
rock what they’ve.
Thanks for the marvelous posting! I definitely enjoyed reading it,
you might be a great author.I will be sure to bookmark your blog and definitely will come back in the future.
I want to encourage you continue your great posts, have a nice
afternoon!
Thanks a lot for sharing this with all people you
really understand what you’re talking about! Bookmarked.
Kindly additionally seek advice from my website =). We can have
a hyperlink exchange arrangement among us
Hello, Neat post. There is a problem togethyer with your site in wweb explorer,
might test this? IE nonetheless is the maket chief and a large component of
people will omit your excellent writing due what To use to mop Hardwood Floors this problem.
This design is spectacular! You obviously know how to keep a reader entertained.Between your wit annd
your videos, I was almost moved to startt my own bllog (well, almost…HaHa!) Excellent job.
I really enjoyed what you had to say, and moree than that, how you presented it.
Too cool!
Feel free to surf to my website; 카지노사이트
A skilled brain injury attorney new york injury legal representative may be able to
assist.
I truly love your blog.. Great colors & theme. Did you create this site yourself?
Please reply back as I’m attempting to create my own personal website and would love to know where you
got this from or exactly what the theme is named.
Cheers!
Also visit my homepage: 온라인슬롯
I’m truly enjoying the design and layout of your site.
It’s a very easy on the eyes which makes it much more enjoyable for me to come
here and visit more often. Did you hire out a designer to create your theme?
Outstanding work!
I like the helpful info you provide in your articles. I will bookmark
your blog and check again right here regularly. I am rather sure I will be informed lots of new stuff right here!
Good luck for the next!
What’s Taking place i’m new to this, I stumbled upon this I’ve found It absolutely useful and it
has aided me out loads. I hope to contribute & help
other users like its aided me. Good job.
My homepage; Leather Living Room Sets
We’re a group of volunteers and starting a new scheme in our community.
Your site provided us with valuable info to work on. You have done an impressive job and our entire community will be grateful to you.
Stop by my web-site: Class C
https://storage.googleapis.com/chinavisa14/research/chinavisa14-(63).html
Jules & Cleo, exclusively at David’s Bridal Polyester Lace up back
with back zipper; totally lined Hand wash Imported.
Ƭhis text is invaluable. How can I find out more?
What’s up to all, the contents existing at this web
site are genuinely amazing for people knowledge, well, keep up the good work fellows.
you are in reality a excellent webmaster. The website loading speed is amazing.
It sort of feels that you’re doing any unique trick.
Moreover, The contents are masterwork. you’ve done a wonderful process on this matter!
Check out my blog post: Used RV Motorhome
https://chinavisa4.netlify.app/research/chinavisa4-(439)
Read on for the most effective mom of the bride attire for
every season, body sort, and price range.
What’s up it’s me, I am also visiting this web page regularly, this web site
is genuinely pleasant and the viewers are truly sharing
good thoughts.
my website; Camping world
This post provides clear idea in favor of the new viewers of
blogging, that actually how to do blogging.
https://chinavisa4.research.au-syd1.upcloudobjects.com/research/chinavisa4-(92).html
The giant florals with the black background are significantly
on trend and the ruching provides a flattering component.
I appreciate, cause I found exactly what I was looking for.
You have ended my four day lengthy hunt! God Bless you man. Have a nice day.
Bye
Ahaa, іts pleasant discusasion concerning this pisce off writing here at thi webpage, I have read all
that, so at tһis time me also commenting here.
https://chinavisa14.b-cdn.net/research/chinavisa14-(522).html
Frumpy, shapeless mother of the bride attire are a factor of the past!
If some one needs to be updated with latest technologies after that
he must be pay a visit this website and be up to date everyday.
My blog post … Leather Living Room Sets
Hi, I log on to your blog like every week.
Your story-telling style is witty, keep doing what you’re
doing!
https://storage.googleapis.com/chinavisa38/research/chinavisa38-(378).html
The capelet dress is right should you like to
cover up your higher arms.
As the admin of this website is working, no
hesitation very shortly it will be renowned, due to its quality contents.
my web site … alternatif badak69
Thanks to my father who told me about this web site, this webpage is truly remarkable.
It’s an awesome piece of writing for all the web viewers; they will obtain advantage from it I am sure.
https://chinavisa8.netlify.app/research/chinavisa8-(207)
As mom of the bride, you might need to discover a look
which enhances these elements, with out being matchy-matchy.
What’s up it’s me, I am also visiting this website daily, this web page is genuinely good and the visitors are genuinely sharing fastidious thoughts.
I do not even know how I ended up here, but I thought this post was good.
I don’t know who you are but certainly you are going to a famous blogger if
you aren’t already 😉 Cheers!
Stop by my site; Teddy Chair
Great blog! Do you have any hints for aspiring writers? I’m
planning to start my own site soon but I’m a little lost on everything.
Would you suggest starting with a free platform like WordPress or go for
a paid option? There are so many choices out there
that I’m totally confused .. Any tips? Appreciate it!
https://chinavisa8.netlify.app/research/chinavisa8-(116)
Keep the lines of communication open all through
the marriage planning process.
It is really a great and helpful piece of info. I’m happy that you just shared this helpful
information with us. Please stay us informed like this. Thanks for sharing.
My homepage :: Modular Couch
I have read a few just right stuff here. Definitely worth bookmarking for revisiting.
I wonder how much attempt you set to make one of these wonderful informative website.
Hi 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 hard time choosing between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your layout seems different then most blogs
and I’m looking for something unique. P.S Apologies for getting off-topic
but I had to ask!
Wow! In the end I got a web site from where I be able to genuinely get
helpful facts regarding my study and knowledge.
Hi there! 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 suggestions?
https://storage.googleapis.com/catering23/research/catering23-(410).html
With over 5 years of experience in bridal, she is an expert on all issues trend.
Сталь Маркет – это ваш надежный партнер в мире металлопроката.
Здесь вы можете найти широкий ассортимент металлопродукции от лидирующих
производителей. Наша компания гарантирует высококачественные товары, соответствующие всем стандартам и требованиям.
Мы предлагаем следующие виды производители металлопроката арматуру,
двутавровую балку, круглую сталь, квадратную сталь, стальную полосу, стальной равнополочный уголок, стальной
неравнополочный уголок, горячекатаный швеллер,
стальные горячекатаные листы и стальную
проволоку.
Преимущества выбора нашей компании, Сталь
Маркет: мы предлагаем широкий ассортимент
металлопроката, продукция высокого качества, доступные
цены, удобную систему оплаты, быструю доставку по всей России и индивидуальный подход к
каждому клиенту.
When someone writes an article he/she retains the plan of a user in his/her mind that how
a user can know it. So that’s why this piece of writing is amazing.
Thanks!
my page … California
naturally like your website however you need to check the spelling on several of your posts.
Several of them are rife with spelling issues
and I in finding it very bothersome to inform
the truth however I’ll definitely come again again.
Also visit my page: slot online
Las Vegas Tankless Water Heaters stands out as the top option for every water heating solution in Las Vegas.
With a focus on offering cost-effective and reliable tankless water heating solutions, we promise complete satisfaction for
all our clients.
Our Edge in Las Vegas Plumbing Services
Expertise in Tankless Water Heaters
Our experts specializes in gas tankless water heaters,
offering hot water on demand without the bulk of traditional units.
Our focus makes us unique in the Las Vegas plumbing sector.
Energy Efficiency
We prioritize reducing energy consumption, assisting you cut
down on energy costs while experiencing constant hot water.
Our solutions aim to enhance efficiency and sustainability.
Customized Solutions
No two homes are alike, and that’s why we offer personalized water heating solutions.
Whether you need a point-of-use heater for a single bathroom or a whole-house system, we have you
covered.
Professional Installation and Maintenance
From installation to maintenance, we make sure that your system operates efficiently with professional maintenance services.
Our technicians have expertise in up-to-date maintenance practices for a variety of systems.
Customer Satisfaction
Customer satisfaction is our top priority. We aim to go above and beyond with every project, providing customized service and
professional recommendations.
Wrapping Up, we stands out from the competition in Las Vegas
for anyone in need of advanced water heating solutions.
Through our dedication to eco-friendly practices,
tailored services, and superior client care, we ensure the
best hot water experience effortlessly.
Opt for our expert team for your next plumbing project and join the legion of content clients
delighting in the advantages of tankless water heating in Las Vegas.
Good way of describing, and good article to obtain facts regarding my presentation topic, which i am going
to present in academy.
Loook at my blog :: 카지노사이트
Howdy! Someone in my Myspace group shared this site with us
so I came to check it out. I’m definitely loving the information.
I’m book-marking and will be tweeting this to my followers!
Exceptional blog and outstanding style and design.