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
It’s very straightforward to find out any topic on net as compared to textbooks, as I found this post at this web page. https://Migration-Bt4.Co.uk/profile.php?id=68625
Good post. I learn something new and challenging on websites I stumbleupon every day.
It’s always interesting to read through articles from other writers and practice something from their web sites.
It’s very straightforward to find out any topic on net as compared to textbooks, as I found this post at this web page. https://Migration-Bt4.Co.uk/profile.php?id=68625
I am sure this paragraph has touched all the internet
visitors, its really really nice piece of writing on building up new blog.
En ellos se incluyen preparaciones típicas, dulces e incluso las bebidas favoritas de los seres queridos que ya no están. El Día de Muertos
es una festividad que celebra la vida y honra la memoria de los seres queridos,
siendo cada bocado de los dulces tradicionales un elemento importante al endulzar la ocasión y
ser una ofrenda especial para los seres queridos que han partido.
Los altares de Día de Muertos suelen constar
de varios niveles que representan el tránsito de las almas hacia el descanso eterno.
Algo que muchos no saben o no se dan cuenta que está presente en un altar
de Día de Muertos y es fundamental, es el agua y la sal, siendo el
agua fuente de la vida que simboliza la pureza del alma, mientras que la sal es un elemento de purificación que sirve para que el cuerpo no
se corrompa en su viaje de ida y vuelta para el siguiente año.
¿CÓMO ARMAR UN ALTAR PARA DÍA DE MUERTOS? Descubre
la rica historia detrás de los tradicionales dulce de Día de Muertos.
Hoy, te invitamos a explorar la rica historia detrás de esta festividad, entender por qué se celebra con tanto fervor y aprender
cómo decorar un altar de muertos con las ricas recetas dulces que deleitarán todos
con tus celebraciones de Día de Muertos.
Thanks for finally writing about > jarman.org.uk | Colourful grep on aix.
< Loved it!
This article presents clear idea in support of the new
users of blogging, that really how to do running a
blog.
Howdy! 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?
Hi there to every one, as I am actually eager of reading this weblog’s post to be updated regularly.
It contains pleasant material.
Hmm it seems like your blog ate my first comment (it
was extremely long) so I guess I’ll just sum it up what I submitted and
say, I’m thoroughly enjoying your blog. I as well am an aspiring blog blogger but I’m still new to everything.
Do you have any recommendations for inexperienced blog writers?
I’d really appreciate it.
my blog post: 우리카지노
I’m really inspired together with your writing skills and also with
the layout for your blog. Is this a paid theme or did you customize it your self?
Either way keep up the nice quality writing,
it is uncommon to see a nice blog like this one today..
http://277469.simplecloud.ru/blogs/1/pochemu-segodnya-pokupka-diploma-pozvolyaet-sekonomit-vremya.php
https://bookofra777.de/baccarats888com/
This is really interesting, You’re a very skilled blogger.
I’ve joined your feed and look forward to seeking more of your wonderful post.
Also, I’ve shared your website in my social networks!
Hi, Neat post. There is a problem with your site in web explorer,
may test this? IE still is the market chief and a large portion of
other folks will pass over your fantastic writing because of this
problem.
Great blog! Do you have any hints for aspiring
writers? I’m planning to start my own blog soon but I’m a little lost on everything.
Would you advise starting with a free platform like WordPress or go for a
paid option? There are so many choices out there that I’m totally overwhelmed ..
Any recommendations? Thanks a lot!
Feel free to visit my blog post; 우리카지노
In fact when someone doesn’t understand then its up to other
users that they will assist, so here it happens.
Great delivery. Solid arguments. Keep up the good
work.
Wow, this paragraph is fastidious, my sister is analyzing such things, thus I
am going to tell her.
Wow that was strange. I just wrote an very long comment but after I clicked submit my comment didn’t show
up. Grrrr… well I’m not writing all that over again. Anyways, just wanted to say fantastic blog!
Here is my web-site … Erotik Forum
you’re truly a excellent webmaster. The website loading pace is incredible.
It kind of feels that you’re doing any unique trick.
In addition, The contents are masterwork. you have performed a magnificent
process in this subject!
my homepage … dkmtoto
I am regular visitor, how are you everybody? This post posted at this web page is in fact fastidious.
In recent years, there has been a growing interest in energy-efficient and cost-effective heating solutions.
my blog; http://bestmusics.godohosting.com/bbs/board.php?bo_table=memo&wr_id=440491
I am extremely impressed with your writing talents as
smartly as with the layout for your weblog. Is that this a
paid subject or did you customize it your self?
Anyway stay up the excellent high quality writing, it is uncommon to
peer a nice blog like this one these days..
I’ve been exploring for a little bit for any high-quality articles or weblog posts in this kind of area .
Exploring in Yahoo I finally stumbled upon this website.
Studying this info So i am happy to show that I have a very good uncanny feeling I discovered just what
I needed. I so much surely will make sure to do not overlook this website and give it a glance on a continuing basis.
I am truly thankful to the holder of this website who has shared this
enormous piece of writing at at this time.
Heya i am for the first time here. I came across this board and I find It truly useful & it helped me
out much. I hope to give something back and help others
like you aided me.
Valuable write ups, Many thanks.
Incredible loads of terrific data!
I blog frequently and I truly thank you for your content.
This great article has truly peaked my interest. I am going to bookmark your site and keep checking for new details about once
per week. I subscribed to your Feed too.
Thank you a lot for sharing this with all people you actually
recognise what you’re speaking approximately! Bookmarked.
Please additionally seek advice from my website =).
We may have a hyperlink exchange arrangement between us
Thanks. I like this!
Feel free to surf to my blog post – https://www.ebay.co.uk/str/kapowukstore/SWEATERS-JUMPERS/_i.html?store_cat=46491923012
Wow that was strange. I just wrote an extremely long comment but after I
clicked submit my comment didn’t appear. Grrrr…
well I’m not writing all that over again. Anyway, just wanted to
say great blog!
Hi to all, how is all, I think every one is getting
more from this web page, and your views are fastidious for
new people.
My blog; dkmtoto
Thanks designed for sharing such a nice idea,
post is fastidious, thats why i have read it fully
Awesome things here. I’m very glad to look your post.
Thanks so much and I am taking a look forward to touch you.
Will you please drop me a e-mail?
Great weblog here! Additionally your web site quite a bit up fast!
What host are you the use of? Can I get your associate hyperlink in your host?
I want my website loaded up as fast as yours lol
Thanks for sharing your info. I truly appreciate your efforts and I am waiting for your next write ups thanks once again.
в отделениях же светодиодное освещение создаст световой поток максимально приближенный благодаря своей температуре к дневному.
Here is my web site; http://studio-pd.ru/index.php?subaction=userinfo&user=ukyfa
This text is invaluable. Where can I find out more?
Howdy are using WordPress for your site platform? I’m new to the blog
world but I’m trying to get started and create my own. Do
you require any html coding knowledge to make your own blog?
Any help would be greatly appreciated!
Fabulous, what a website it is! This weblog presents helpful data
to us, keep it up.
My web blog – achizitii publice
This information is priceless. Where can I find out more?
I am truly delighted to glance at this weblog posts which
contains plenty of helpful data, thanks for
providing such statistics.
rikvip
Hey very nice site!! Guy .. Excellent .. Amazing ..
I will bookmark your site and take the feeds additionally?
I am satisfied to find so many useful information right here in the
put up, we want work out more techniques in this regard, thank you
for sharing. . . . . .
Как правильно подготовиться
к свадьбе ?
Свадьба – радостное и самое великолепное событие в жизни пары.
После того как парень сделал предложение, наступает волнующее время – время подготовки к свадьбе.
Столько всего необходимо сделать.
Как все успеть и ничего не упустить?
Многие прибегают к помощи свадебного организатора.
Но его услуги стоят довольно дорого, а в преддверии свадьбы лишних денег нет.
Можно попробовать организовать торжество самостоятельно, это не так уж и сложно.
А как это сделать, изложено в данной
статье.
Как организовать свадьбу?
– Заявление. Первое, что вам нужно совершить
– это подать заявление в ЗАГС. Причем, если свадьбу вы желаете сыграть летом, то
посетить ЗАГС необходимо как можно раньше.
В свадебный сезон очень трудно попасть на конкретную дату.
– Ресторан. После того как дата и время
торжества будут известны, отправляйтесь на поиски
банкетного зала. Сейчас выбор огромный.
Хотите роскошно отметить
событие? Выбирайте рестораны для свадьбы казани
.
А если скромно, то кафе или столовую.
Летом возможно уехать за город,
арендовать большую беседку или поставить свой
шатер.
– Пригласительные. Составьте список гостей, которых желаете видеть на своей свадьбе.
Причем, не стоит звать всех знакомых своих родителей и соседей.
Пусть на торжестве будут самые близкие люди.
Далее в типографии закажите именные пригласительные и отправьте всем приглашенным.
Да, сейчас часто отправляют их в электронном
виде. Но, поверьте, получить отпечатанные пригласительное гораздо
приятнее.
– Кольца. Кольца вы можете купитьв магазине или сделать
на заказ с именной гравировкой.
Раньше считалось, что кольца у
мужа и жены должны быть одинаковыми.
Впрочем сейчас все изменилось.
Часто девушки выбирают кольца с камнями, а мужчины лаконичные простые варианты.
– Наряд. Его тоже лучше выбирать заблаговременно, чтобы была возможность неспешно обойти все магазины, посмотреть разные варианты.
Либо что-то заказать в интернете или перешить.
Если свадьба зимой, то стоит помнить, что без верхней одежды не обойтись.
А если летом, то, наоборот, чем
легче будет платье невесты и
костюм жениха, тем лучше.
– Прическа и макияж. Имеют важное значение
при составлении образа невесты. Поэтому
прежде, чем выбрать специалиста, нужно найти несколько кандидатов, а уже потом
остановиться на лучшем в своем деле.
Заранее узнайте, приедет
специалист к вам домой или вам придется отправиться в
салон красоты. Это поможет в дальнейшем правильно
распланировать день.
– Фотограф и видеооператор. Вам нужно решить кому
вы доверите съемку свадьбы.
Часто выбирают фотографа и оператора в одном лице.
Но все же лучше, если это будет два разных человека.
Ведь один человек может пропустить что-то
важное. А исправить это потом будет уже
невозможно.
– Диджей и ведущий. Повстречайтесь
с несколькими лично перед тем,
как выбрать кого-то одного. С кем вам комфортнее?
Кто, по вашему мнению, точно найдет общий язык
с вашими гостями? На нем и нужно остановить свой выбор.
– Транспорт. Сейчас действительно у каждой семьи имеется автомобиль, однако все же стоит предварительно узнать поедут гости на своей
машине или решат оставить ее дома.
Если кто-то будет без автомобиля, то вам следует
заказать необходимый транспорт и украсить его в том же стиле, что и автомобиль новобрачных.
Asking questions are truly nice thing if you are not understanding something totally, but this
post presents good understanding even.
Howdy would you mind stating which blog platform
you’re working with? I’m looking to start
my own blog soon but I’m having a tough time selecting
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 being off-topic but I had to ask!
Great blog here! Also your site loads up very fast! What host are you using?
Can I get your affiliate link to your host? I wish
my site loaded up as fast as yours lol
Hello there, You’ve done a great job. I will certainly digg it and personally suggest to my friends.
I’m sure they’ll be benefited from this site.