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
What’s up colleagues, how is everything, and what you desire to say regarding this article, in my view its genuinely awesome
in support of me.
You actually make it seem so easy with your presentation but I find this topic to
be really something that I think I would never understand.
It seems too complicated and extremely broad for me.
I’m looking forward for your next post, I’ll try to get the hang of it!
Having read this I believed it was very informative.
I appreciate you finding the time and effort to put this informative article together.
I once again find myself personally spending a significant amount of time
both reading and posting comments. But so what, it was still worthwhile!
Also visit my homepage :: Palampur escort agency
I visited many web pages but the audio quality for audio songs present at this
web page is truly fabulous.
I like the valuable info youu provide iin your articles.
I will bookmark your weblog and check again here frequently.
I am quite sure I’ll learn many new stuff right here! Best of luck for the next!
Stop by my website – Massage Forum
Pretty! This has been a really wonderful article.
Thanks for supplying these details.
My web blog; Erotik Forum
I am regular reader, how are you everybody?
This post posted at this site is really good.
I’m gone to say to my little brother, that he should also pay
a quick visit this webpage on regular basis to get updated from latest
information.
I’ve been exploring foг ɑ littⅼе for any high-quality
articles or blog posts іn this sort оf space . Exploring іn Yahoo І
fіnally stumbled upon thiѕ website. Studying tһіs informatіon So i’m haрpy to convey thаt I’ve an incredibly јust riցht uncanny feeling Ι came upоn eⲭactly ѡhat I
needed. I most fⲟr sure will make ϲertain t᧐ don?t fail tⲟ
remember this website ɑnd provides it a glance on a constant
basis.
Review mү site :: sbobetpub – http://sbobetpub.com –
Good day! This is my first visit to your blog! We are a team of volunteers and starting a new project in a community in the same niche.
Your blog provided us beneficial information to work on. You have done a wonderful job!
my site: Massage Forum
Medicament information. Generic Name.
generic zithromax
Everything information about drug. Get now.
Фальшивые рубли, в большинстве случаев, копируют с целью мошенничества и незаконного обогащения. Шулеры занимаются клонированием российских рублей, формируя поддельные банкноты различных номиналов. В основном, фальсифицируют банкноты с более высокими номиналами, такими как 1 000 и 5 000 рублей, поскольку это позволяет им получать крупные суммы при меньшем количестве фальшивых денег.
Процесс фальсификации рублей включает в себя использование высокотехнологичного оборудования, специализированных принтеров и особо подготовленных материалов. Шулеры стремятся максимально точно воспроизвести средства защиты, водяные знаки, металлическую защитную полосу, микротекст и другие характеристики, чтобы затруднить определение поддельных купюр.
Поддельные денежные средства часто вносятся в оборот через торговые площадки, банки или прочие учреждения, где они могут быть незаметно скрыты среди настоящих денег. Это порождает серьезные проблемы для финансовой системы, так как поддельные купюры могут вызывать потерям как для банков, так и для населения.
Важно отметить, что имение и применение фальшивых денег считаются уголовными преступлениями и могут быть наказаны в соответствии с нормативными актами Российской Федерации. Власти энергично противостоят с подобными правонарушениями, предпринимая действия по выявлению и пресечению деятельности банд преступников, занимающихся фальсификацией российской валюты
Лучший оригинальный сайт 1win
Hey would you mind letting me know which hosting company you’re utilizing?
I’ve loaded your blog in 3 different web browsers and I must say this blog loads a lot quicker then most.
Can you recommend a good web hosting provider at a honest price?
Kudos, I appreciate it!
Hello, i feel that i noticed you visited my site so i came to return the
prefer?.I’m trying to to find issues to enhance my website!I assume its adequate to use a few of
your ideas!!
HD porn
Hello everyone, it’s my first visit at this web
page, and paragraph is really fruitful designed
for me, keep up posting these types of articles.
Фальшивые рубли, часто, подделывают с целью мошенничества и незаконного получения прибыли. Преступники занимаются подделкой российских рублей, формируя поддельные банкноты различных номиналов. В основном, подделывают банкноты с более высокими номиналами, вроде 1 000 и 5 000 рублей, ввиду того что это позволяет им добывать крупные суммы при уменьшенном числе фальшивых денег.
Процесс фальсификации рублей включает в себя использование технологического оборудования высокого уровня, специализированных печатающих устройств и специально подготовленных материалов. Злоумышленники стремятся максимально детально воспроизвести средства защиты, водяные знаки безопасности, металлическую защиту, микротекст и другие характеристики, чтобы замедлить определение поддельных купюр.
Поддельные денежные средства периодически вносятся в оборот через торговые площадки, банки или прочие учреждения, где они могут быть легко спрятаны среди настоящих денег. Это создает серьезные трудности для финансовой системы, так как фальшивые деньги могут привести к убыткам как для банков, так и для граждан.
Важно отметить, что владение и использование фальшивых денег являются уголовными преступлениями и могут быть наказаны в соответствии с законодательством Российской Федерации. Власти энергично противостоят с подобными правонарушениями, предпринимая меры по выявлению и пресечению деятельности банд преступников, вовлеченных в фальсификацией российской валюты
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 create my own blog
and would like to know where u got this from. appreciate it
Оригинальный сайт беттинга в России здесь 1win
I loved as much as you will receive carried out
right here. The sketch is attractive, your authored subject matter stylish.
nonetheless, you command get bought an impatience over that you wish
be delivering the following. unwell unquestionably come further formerly again since exactly the
same nearly a lot often inside case you shield this hike.
I always spent my half an hour to read this webpage’s articles all the time along with a cup of coffee.
I’m very happy to discover this web site. I want to to thank
you for your time due to this wonderful read!! I definitely loved
every little bit of it and i also have you book-marked to see
new stuff on your site.
Simply desire to say your article is as astounding. The clearness for your post is just
nice and that i can think you’re knowledgeable in this subject.
Fine with your permission let me to snatch your feed to stay up to date with impending
post. Thanks a million and please continue the enjoyable work.
porn in HD
He made a disgusting chili beaterhttps://http://www.bither-wallet.com/ the sharper the more durable.
among your acquaintances do not have a profile for reviews?
outline your email email and password for access to comments.
You really make it appear really easy with your presentation but I in finding this topic to be really something which
I think I would by no means understand. It seems too
complicated and very broad for me. I am having a look forward
on your next publish, I will try to get the dangle of it!
It’s very simple to find out any matter on web
as compared to books, as I found this piece of writing at this website.
Can you tell us more about this? I’d like to find out some additional information.
Ketika mengeksplorasi dunia slot online, saya bertemu dengan Corla188 sebagai salah
satu destinasi yang sangat menarik. Yang menjadikan Corla188 berbeda bukan hanya variasi permainannya yang luas, melainkan komitmennya
terhadap kenyamanan dan keamanan pemain. Dari pengalaman pribadi, hal yang saya nilai tinggi adalah layanan pelanggan yang responsif dan sangat membantu, memastikan bahwa setiap masalah atau pertanyaan yang saya miliki ditangani dengan cepat dan efisien.
Hello there, I found your website by means of Google whilst looking for a comparable subject, your web site came up, it
appears good. I’ve bookmarked it in my google bookmarks.
Hello there, simply changed into alert to your weblog thru Google, and located that it’s truly informative.
I am gonna be careful for brussels. I’ll be grateful if you happen to proceed this in future.
Many folks shall be benefited out of your writing.
Cheers!
What a information of un-ambiguity and preserveness of precious experience on the topic of unexpected feelings.
https://boosty.to/liamedison/posts/b72a9374-6d73-4516-92f5-b123736adf19?share=success_publish_link
Hi, i think that i saw you visited my blog thus
i came to “return the favor”.I’m trying to
find things to improve my website!I suppose
its ok to use some of your ideas!!
A lista apresenta links de grandes portais e de diversos nichos de mercado, permitindo http://ewlu.art/index.php/Beginner_s_Guide_To_Intermittent_Fasting os usuários obtenham links poderosos para seus próprios websites.
I wanted to thank you for this good read!!
I certainly loved every bit of it. I have you bookmarked to
check out new stuff you post…
Do you mind iif Ι quote a few of your articles as ⅼong aas I proᴠide credіt
andd s᧐urces back to your site? My bⅼog iѕ in the very same area of interest as yoսjrs and my users would truly
benesfit from some of thе information you pгoviԀe herе.
Please let me know iіf thіs oк with you. Reɡards!
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.
It’s awesome in support of me to have a site,
which is useful in favor of my knowledge.
thanks admin
I have been browsing on-line more than 3 hours today, but I by no means found any attention-grabbing article like yours.
It’s beautiful price enough for me. In my view, if all web owners and bloggers made good
content as you probably did, the net will likely be
a lot more useful than ever before.
Hey I know this is off topic but I was wondering if you
knew of any widgets I could add to my blog
that automatically tweet my newest twitter updates.
I’ve been looking for a plug-in like this for quite some time
and was hoping maybe you would have some experience with something like this.
Please let me know if you run into anything. I truly enjoy
reading your blog and I look forward to your new updates.
What i don’t realize is in reality how you are not actually a
lot more well-favored than you might be right now. You are very intelligent.
You understand therefore significantly on the subject of this subject, made
me personally believe it from numerous numerous angles.
Its like men and women aren’t involved unless it is something to
accomplish with Woman gaga! Your individual stuffs outstanding.
Always handle it up!
You must first install Shortcuts on your iPhone or iPad before
you can install the Shortcut that downloads videos.
Настоящий сайт 1вин здесь 1win. Рекомендую!
Cold wallets eliminate the risk that as one of the players
will hack your online wallet, and http://www.smogtoken.io will steal your cryptocurrency.
I’m curious to find out what blog system you have been using?
I’m having some small security issues with my latest website and I would like
to find something more secure. Do you have any
suggestions?
Thank you for any other informative site. Where else may I am
getting that type of info written in such an ideal approach?
I’ve a mission that I am simply now operating on, and I have been on the glance
out for such info.
It’s hard to find educated people on this subject, however,
you seem like you know what you’re talking about!
Thanks
Wow! At last I got a web site from where I can truly obtain valuable facts regarding my study and knowledge.
I have read so mwny posts regarding tthe blogger lovers
however this post is really a nice paragraph, keep it up.
My web page; Massage Berichten