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
Having read this I thought it was really informative.
I appreciate you finding the time and effort to put this information together.
I once again find myself personally spending
way too much time both reading and commenting. But so what, it was still worthwhile!
I just could not leave your website prior to suggesting that I extremely loved the usual info
a person supply to your guests? Is gonna be again steadily in order to inspect new posts
Incredible! This blog looks just like my old one! It’s on a completely different subject but it has pretty much the
same layout and design. Wonderful choice of colors!
Hi there just wanted to give you a quick heads up and let you
know a few of the images aren’t loading correctly. I’m not sure why but I think its a linking issue.
I’ve tried it in two different internet browsers and both show the same outcome.
What i don’t realize is actually how you are no longer
actually a lot more well-preferred than you might be right now.
You’re so intelligent. You already know thus significantly in terms of this matter, made me in my opinion imagine it from a
lot of varied angles. Its like women and men aren’t involved unless it
is something to do with Lady gaga! Your personal stuffs outstanding.
All the time take care of it up!
Incredible points. Solid arguments. Keep up the good spirit.
Genuine HGH Benefits (NewULife Hgh Gel Not Checked Yet).
Have a look at my blog post Is microsoft project the best project management software
Hmm it looks like your website ate my first comment (it
was super long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog.
I too am an aspiring blog writer but I’m still new to the whole thing.
Do you have any tips and hints for inexperienced blog
writers? I’d definitely appreciate it.
I was very pleased to discover this page.
I need to to thank you for your time just for this fantastic read!!
I definitely liked every bit of it and I have you book marked to see new things
in your blog.
Excellent post. I was checking constantly this weblog and I am inspired!
Very useful info specially the ultimate section :
) I take care of such info a lot. I used to be seeking this particular info for a very lengthy time.
Thanks and best of luck.
Fantastic goods from you, man. I have understand your stuff previous to and you are just extremely excellent.
I actually like what you have acquired here, really like what you’re
stating and the way in which you say it. You make it entertaining and you still care for to keep
it smart. I can’t wait to read far more from you.
This is really a wonderful site.
Let me reveal you in my evaluation of NewULife.
My page :: project management software tools free
Incredible! This blog looks just like my old one!
It’s on a entirely different topic but it has pretty much the same page layout and design. Outstanding choice of colors!
They have products to market or services to offer.
Also visit my homepage: project management software microsoft
Wow, this paragraph is good, my sister is analyzing these
things, thus I am going to tell her.
Feel free to visit my homepage – Erotik Forum
XYGENYX, a licensing company for FDA-registered products.
Look at my page: Bookmarks
магазин фальшивых денег купить
Темные закоулки сети: теневой мир продажи фальшивых купюр”
Введение:
Поддельные средства стали неотъемлемой частью теневого мира, где пункты сбыта – это источники серьезных угроз для экономики и общества. В данной статье мы обратим внимание на локации, где процветает подпольная торговля фальшивыми купюрами, включая засекреченные зоны интернета.
Теневые интернет-магазины:
С развитием технологий и распространением онлайн-торговли, точки оборота фальшивых купюр стали активно функционировать в засекреченных местах интернета. Скрытые онлайн-площадки и форумы предоставляют возможность анонимно приобрести фальшивые деньги, создавая тем самым серьезную угрозу для экономики.
Опасные последствия для общества:
Точки оборота фальшивых купюр на скрытых веб-платформах несут в себе не только угрозу для финансовой стабильности, но и для обычных граждан. Покупка поддельных денег влечет за собой опасности: от судебных преследований до утраты доверия со стороны сообщества.
Передовые технологии подделки:
На темных интернет-ресурсах активно используются передовые технологии для создания высококачественных подделок. От печатающих устройств, способных воспроизводить средства защиты, до использования криптовалютных платежей для обеспечения анонимности покупок – все это создает среду, в которой трудно обнаружить и остановить незаконную торговлю.
Необходимость ужесточения мер борьбы:
Противостояние с подпольной торговлей поддельных денег требует комплексного подхода. Важно ужесточить нормативные акты и разработать эффективные меры для выявления и блокировки теневых интернет-магазинов. Также критически важно поднимать готовность к информации общества относительно опасностей подобных практик.
Заключение:
Площадки продаж поддельных денег на темных уголках интернета представляют собой серьезную угрозу для финансовой стабильности и общественной безопасности. В условиях расцветающего цифрового мира важно акцентировать внимание на противостоянии с подобными практиками, чтобы защитить интересы общества и сохранить доверие к экономическому порядку
They have products to sell or solutions to provide.
Look at my web page … project management software free trial
Lovely information. Cheers!
Look at my website; Casual Men’s Knit Tops (https://www.ebay.co.uk/str/kapowukstore/SWEATERS-JUMPERS/_i.html?store_cat=46491923012)
Thank you, I’ve just been looking for info approximately this topic for a long time
and yours is the greatest I have discovered so far.
However, what in regards to the conclusion? Are you sure concerning
the supply?
Let me show you in my testimonial of NewULife.
My web site :: Bookmarks
Хотите испить удачу и почувствовать азарт, не рискуя реальными деньгами?
the dog house megaways в рублях позволит вам упиться игрой в режиме
демо-версии, при этом вы сможете заприметить свои потенциальные выигрыши в рублях.
dog house slot – это увлекательная исполнение
с множеством возможностей для
выигрыша. Не упустите шанс отведать удачу и упиться азартом в компании милых пушистых собачек.
Играйте в dog house нынче и погрузитесь в захватывающий мир азартных развлечений!
Хотите испытать удачу и выиграть реальные денежки?
the dog house доступен для игры в рублях, обеспечивая вам возможность выиграть крупные суммы и получить незабываемые впечатления.
dog house casino – это место, где ваши азартные мечты становятся реальностью.
Здесь вы найдете самые популярные версии слота the dog house и тьма-тьмущая других захватывающих игр.
Соберите выигрышные комбинации символов и активируйте бонусные раунды,
чтобы усилить свои шансы на
крупные призы. Вас ждут яркие эмоции и
захватывающие моменты во пора игры в
the dog house.
Definitely believe that which you said. Your favorite
reason seemed to be on the net the easiest thing to be aware of.
I say to you, I definitely get irked while people think about worries that they just do not know about.
You managed to hit the nail upon the top as well as defined out the whole
thing without having side-effects , people can take
a signal. Will probably be back to get more. Thanks
XYGENYX, a licensing company for FDA-registered items.
Here is my site Bookmarks
They have products to market or services to
provide.
my web blog … Bookmarks
Hey There. I found your blog using msn. That is an extremely neatly written article.
I will be sure to bookmark it and come back to learn extra of your
useful info. Thank you for the post. I’ll definitely return.
What is New U Life SOMADERM Transdermal Gel.
my blog post; project Management Software microsoft
XYGENYX, a licensing firm for FDA-registered items.
Look at my homepage: project portfolio management software microsoft
NewULife Ranks. Welcome to my NewUlife Evaluation.
Feel free to surf to my site; project management software free
What is New U Life SOMADERM Transdermal Gel.
Stop by my homepage; Bookmarks
Hello, this weekend is fastidious designed for me,
for the reason that this moment i am reading this great
informative post here at my house.
They have products to market or solutions to use.
My web page … project management software microsoft teams
Real HGH Benefits (NewULife Hgh Gel Not Examined Yet).
Also visit my blog; Bookmarks
They have items to market or solutions to offer.
Here is my web page item579225813
What is New U Life SOMADERM Transdermal Gel.
my web-site; item579401672
Medicines prescribing information. Cautions.
kamagra price
All about medication. Get information now.
USP human development hormone (somatropin).
Check out my web-site … project management software monday
What is New U Life SOMADERM Transdermal Gel.
Look at my web-site – project management software monday
They have products to market or services to provide.
My web blog; project management software like monday
In this situation, the life insurance company’s cash.
Here is my page – Monday project management software review
Hi would you mind letting me know which web host 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 suggest a good web hosting provider at
a fair price? Cheers, I appreciate it!
What is New U Life SOMADERM Transdermal Gel.
Feel free to visit my web-site: item579402182
An artificial USP human development hormone (somatropin).
Check out my website: project management software free
Good answers in return of this difficulty with solid arguments and describing the whole thing
concerning that.
They have items to market or solutions to use.
Feel free to surf to my blog post – Bookmarks
XYGENYX, a licensing business for FDA-registered products.
my page item579226796
USP human growth hormone (somatropin).
My homepage item579401831
survivability of the profit forecasting system
does not need user manipulation, “https://http://www.green-bitcoin.org/ ” is a common feature of gaming entertainment.
camisetas de futbol para niños baratas
Let me show you in my evaluation of NewULife.
Feel free to surf to my web site; item579229238