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
I do consider all of the ideas you have offered for your post.
They are really convincing and will definitely work.
Still, the posts are too brief for starters. May you please prolong them a little from next time?
Thank you for the post.
whoah this weblog is great i really like reading your posts.
Stay up the good work! You realize, many individuals are hunting around
Golden Doodle Puppies For Sale this information, you could aid
them greatly.
Thanks for finally writing about > jarman.org.uk | Colourful grep on aix.
< Liked it!
I was sugɡested this blog via my cousin. I am now nnot certain whether
or not this publish is written by him as no one
elѕe realize such particular about my trouble. You are wonderfuⅼ!
Thanks!
Today, I went to the beach 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 placed
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 totally off topic but I had to tell someone!
Feel free to surf to my blog – Golden Doodle Grooming
What’s Happening i am new to this, I stumbled upokn this I have discovered It absolutely helpful and it
has helped me out loads. I am hoping to give a contribution & help other customers like its
helped me. Great job.
Here is my blog post; electronic component test lab
Touche. Sound arguments. Keep up the great effort.
Feeel free to surf to my page … Massage Forum
site porn
can i get cheap motilium without prescription
Excellent, what a weblog it is! This weblog presents helpful information to us, keep it up.
I like the valuable info you provide in your articles.
I’ll bookmark your weblog and check again here frequently.
I am quite certain I will learn a lot of new stuff right here!
Good luck for the next!
Hi there, just became aware of your blog through Google,
and found that it is really informative. I’m going to watch out for brussels.
I’ll be grateful if you continue this in future. Many people will be benefited
from your writing. Cheers!
Pretty! This was an incredibly wonderful article.
Thank you for providing this info.
Pretty nice post. I just stumbled upon your blog and wished to say that I’ve truly enjoyed browsing
your blog posts. In any case I will be subscribing to
your rss feed and I hope you write again soon!
hoki 1881
I do not even know the way I finished up right here, however I beliewved this popst used to be great.
I do not realize whho you’re but definitely you’re goingg to a well-known blogger if yoou aren’t already.
Cheers!
Check out my homepage … praca Kierowca Dania
First off I want to say awesome blog! I had a quick question that I’d like to ask if you don’t mind.
I was curious to find out how you center yourself and
clear your head before writing. I have had difficulty clearing my mind in getting my ideas out there.
I do take pleasure in writing however it just seems like the first 10 to
15 minutes are wasted just trying to figure out how to begin. Any suggestions or tips?
Thank you!
In recent years, CBD products have taken the health and wellness industry by storm. With claims of numerous health benefits, consumers are turning to http://www.kuangjiab.com:8000/cart/bbs/board.php?bo_table=free&wr_id=986446 products as a natural alternative to traditional medications.
Do you mind if I quote a couple of your articles as long as I provide credit
and sources back to your blog? My website is in the very
same area of interest as yours and my visitors would really benefit from some of
the information you provide here. Please let me know if this okay with you.
Regards!
Also visit my homepage … Golden Doodle Puppies
Excellent ɡoߋds from you, man. I’ve be mindful your stuff prior to and
you are simply extremely magnificent. I realⅼy ⅼike
what you’ve received here, certainly like ᴡhat you’re saying and the
way through which you assert it. You make it entertaining annd yyou stilⅼ take cɑre
of to stay it smart. I can’t wait to learn mujch more from you.
This is reɑlly a great web site.
Hi, the whole thing is going sound here and ofcourse
every one is sharing facts, that’s in fact good, keep up
writing.
Feel free to surf to my web blog :: Golden Doodle Personality
Every weekend i used to visit this website, for the reason that i
want enjoyment, for the reason that this this web site conations really fastidious
funny stuff too.
Elite Garage Door Services of Northwest Arkansas
103 E Alpine St Suite 2
Siloam Springs, AR 72761
(479) 636-7658
https://koreanforeducators.com/board/bbs/board.php?bo_table=free&wr_id=33649
Hello, yeah this post is really pleasant and I have learned lot of things
from it about blogging. thanks.
I do not even understand how I finished up here, however I assumed this publish was once good.
I don’t realize who you’re however definitely you’re going to a famous
blogger if you happen to are not already. Cheers!
Incredible story there. What occurred after?
Thanks!
Visit my site – sibling living in deceased parents house
Thanks for every other informative website. The place else may just I am getting that type of information written in such an ideal manner?
I have a mission that I am simply now operating on, and I’ve been on the look out for such info.
You’re so interesting! I don’t think I have read through a single thing like this before.
So nice to find another person with original thoughts on this subject matter.
Really.. many thanks for starting this up. This web site is one thing that
is required on the internet, someone with some originality!
Your style is very unique compared to other people I’ve read stuff from.
Thank you for posting when you have the opportunity, Guess I will just book mark this web site.
This website definitely has all the information I needed concerning this subject and didn’t know who to ask.
my web page: find a trust
История строительства Кнаубом Андреем НПЗ Томскнефтерепеработка, планов на модернизацию и совершенствование корпоративной культуры. Привлечение молодых специалистов, улучшение условий труда всегда были в приоритете у бизнесмена кнауб андрей томскнефтепереработка
Hello there! Quick question that’s entirely off topic. Do you know how to make your site
mobile friendly? My blog looks weird when viewing from my iphone.
I’m trying to find a template or plugin that might be able to resolve this problem.
If you have any suggestions, please share. Thank you!
Great post. I am going through some of these issues as well..
I want to to thank you for this wonderful read!! I certainly loved every
bit of it. I’ve got you book-marked to check
out new stuff you post…
Hi there! I’m at work surfing around your blog from my new
iphone 3gs! Just wanted to say I love reading through your blog and look forward to all your posts!
Carry on the fantastic work! https://sobrouremedio.Com.br/author/roslynmoats/
Ahaa, its good dialogue on the topic of this post at this place at this webpage, I have read all that, so at
this time me also commenting here.
Hi there! I’m at work surfing around your blog from my new iphone 3gs!
Just wanted to say I love reading through your blog and look forward to all your posts!
Carry on the fantastic work! https://sobrouremedio.Com.br/author/roslynmoats/
May I just say what a relief to discover an individual who really knows what they’re discussing on the web.
You actually know how to bring a problem to light and make it important.
More and more people need to read this and understand
this side of your story. I was surprised you’re not more popular given that you definitely
possess the gift.
Also visit my blog :: trust contest california
Good day! Would you mind if I share your blog with my facebook group?
There’s a lot of folks that I think would really appreciate your content.
Please let me know. Thanks
Aksi118 adalah link situs slot gacor gampang menang maxwin hari ini
terbaru terbaik 2024 yang menggunakan server pragmatic play.
link slot gacor hari ini juga sudah mendapat lisensi terbaik dengan sistem terbaru yang akan membuat kamu semakin bersemangat memainkanya.
История строительства Кнаубом Андреем НПЗ Томскнефтерепеработка, планов на модернизацию и совершенствование корпоративной культуры. Привлечение молодых специалистов, улучшение условий труда всегда были в приоритете у бизнесмена кнауб андрей биография
История строительства Кнаубом Андреем НПЗ Томскнефтерепеработка, планов на модернизацию и совершенствование корпоративной культуры. Привлечение молодых специалистов, улучшение условий труда всегда были в приоритете у бизнесмена кнауб андрей
What’s up i am kavin, its my first time to commenting anyplace, when i read this paragraph i thought i could also make comment due to this sensible post.
Обратите внимание, что при регистрации важно ввести действующий адрес
электронной почты, эдак ровно прямо по нему мы будем снюхиваться с вами и уведомлять о специальных акциях и бонусах.
8. Используйте бонусные средства.
Приветственный бонус можно использовать
для ставок в играх Кент казино.
Он позволит вам отведать удачу и умножить свои шансы на выигрыш.
Чтобы получить бонусы, необходимо соорудить первый депозит на ваш счет
в Кент казино. Мы предлагаем различные
способы пополнения счета, включая банковские карты, электронные кошельки и банковский перекидывание.
Выберите покойный для вас способ и следуйте инструкциям на экране для завершения операции.
Не забывайте топтать за новостями
нашего казино, дабы быть в курсе всех акций, специальных предложений и бонусов,
которые мы предлагаем нашим активным и лояльным игрокам!
Требования по отыгрышу: Большинство приветственных
бонусов имеют требования по отыгрышу.
Это означает, что вы должны сработать определенное число
ставок на реальные деньги,
чтобы выигрыш от бонуса можно было
вывести. Такие требования обычно указываются в условиях
бонусной программы.
Hi there! I realize this is somewhat off-topic
but I had to ask. Does managing a well-established blog such as yours require a lot of
work? I am completely new to running a blog however I do write in my
diary every day. I’d like to start a blog so I can easily share
my own experience and thoughts online. Please let me know if
you have any recommendations or tips for brand new aspiring bloggers.
Thankyou!
Check out my page :: Golden Doodle Toys
История строительства Кнаубом Андреем НПЗ Томскнефтерепеработка, планов на модернизацию и совершенствование корпоративной культуры. Привлечение молодых специалистов, улучшение условий труда всегда были в приоритете у бизнесмена кнауб андрей бизнесмен
My coder is trying to convince me to move tto .net from
PHP. I have always disliked the idea because of the expenses.
But he’s tryiong none thhe less. I’ve been usijg
WordPress on a number of websites for about a year and am anxious about switching to another platform.
I have heard excellent things about blogengine.net. Is there a wway I
can import alll my wordpress posts intyo it? Any kind of help would be greatly appreciated!
my homepage Massage Forum, https://www.massagebbs.com/,
Meds prescribing information. Brand names.
provigil no prescription
Some about drug. Read information here.
I am really delighted to glance at this website posts which carries plenty
of useful information, thanks for providing these data.
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.