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
Howdy! Someone in my Myspace group shared this website 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!
Great blog and outstanding design.
Stop by my webpage: solana telegram sniper bot
What’s up friends, fastidious paragraph and good urging commented at this place, I am genuinely enjoying by these.
Ich werde unverzüglich greifen, da ich nicht Ihre E-Mail-Abonnementverknüpfung oder den Newsletter-Service finden kann.
Haben Sie einen? Freundlicherweise erlauben Sie mich erkennen, damit ich mich anmelden kann.
Danke.
I know this website presents quality depending articles and other information, is
there any other site which provides these kinds of information in quality?
Sweet blog! I found it while surfing around on Yahoo News.
Do you have any suggestions on how to get listed in Yahoo News?
I’ve been trying for a while but I never seem to get there!
Thank you
Here is my homepage :: copier repair
Hello! Quick question that’s entirely off topic.
Do you know how to make your site mobile friendly?
My website looks weird when viewing from my iphone4.
I’m trying to find a template or plugin that might be able
to fix this issue. If you have any recommendations, please share.
Many thanks!
I enjoy reading through a post that will make people think.
Also, thanks for allowing for me to comment!
It’s very effortless to find out any matter on net as compared to books,
as I found this article at this website.
It’s a shame you don’t have a donate button! I’d certainly donate to this excellent
blog! I suppose for now i’ll settle for book-marking and adding your RSS feed to my Google account.
I look forward to brand new updates and will talk about this blog with my Facebook group.
Chat soon!
Great goods from you, man. I have understaand your stuff previous to aand
you are just extremely wonderful. I actually like what you have acquired here, really like what you are stating and the way in which you say it.
You make it enjoyable and you still take care of
to keep itt smart. I can not wait tto read far more from
you. This iss actually a wonderful website.
Here is my website Anantapur escort agency
It’s an amazing article in support of all the online people;
they will obtain advantage from it I am sure.
I think the admin of this web page is truly working hard in favor of his site, as
here every information is quality based stuff.
certainly like your web site however you need
to test the spelling on several of your posts. A number of them are rife with
spelling issues and I find it very troublesome to tell the truth however I’ll certainly come again again.
Here is my site; Sexleben
This piece of writing presents clear idea in favor of the new viewers of
blogging, that genuinely how to do running a blog.
Your mode of telling everything in this article is really pleasant, every one
can effortlessly be aware of it, Thanks a lot.
Have a look at my homepage – epoxy flooring austin tx
Hi there to every body, it’s my first pay a
quick visit of this web site; this webpage contains awesome
and truly good information designed for visitors.
Highly descriptive blog, I liked that a lot.
Will there be a part 2?
Hello colleagues, how is the whole thing, and what you would like to say about this paragraph, in my view its in fact awesome in favor of me.
If you are going for most excellent contents like me, only pay a quick
visit this web site everyday as it offers quality contents, thanks
An impressive share! I have just forwarded this onto a co-worker who had been doing a
little research on this. And he in fact bought me breakfast simply because I stumbled upon it for him…
lol. So let me reword this…. Thank YOU for the
meal!! But yeah, thanks for spending some time to talk about this subject here on your website.
A skilled mind brain injury lawyers vancouver lawyer may have the ability to aid.
Hi! This post couldn’t be written any better!
Reading through this post reminds me of my old room mate!
He always kept talking about this. I will forward this page to him.
Pretty sure he will have a good read. Thanks
for sharing!
My site garage floor epoxy austin tx
you are actually a just right webmaster. The website loading speed is incredible.
It sort of feels that you’re doing any unique trick.
Moreover, The contents are masterpiece. you have performed a magnificent job
in this matter!
Thanks for your personal marvelous posting! I definitely enjoyed reading it, you may 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 to continue your great job, have a nice weekend!
Обнал карт: Как гарантировать защиту от обманщиков и сохранить защиту в сети
Современный общество высоких технологий предоставляет удобства онлайн-платежей и банковских операций, но с этим приходит и нарастающая угроза обнала карт. Обнал карт является процессом использования похищенных или незаконно полученных кредитных карт для совершения финансовых транзакций с целью маскировать их источник и заблокировать отслеживание.
Ключевые моменты для безопасности в сети и предотвращения обнала карт:
Защита личной информации:
Будьте внимательными при передаче личной информации онлайн. Никогда не делитесь картовыми номерами, защитными кодами и другими конфиденциальными данными на непроверенных сайтах.
Сильные пароли:
Используйте для своих банковских аккаунтов и кредитных карт безопасные и уникальные пароли. Регулярно изменяйте пароли для усиления безопасности.
Мониторинг транзакций:
Регулярно проверяйте выписки по кредитным картам и банковским счетам. Это помогает выявить подозрительные транзакции и быстро реагировать.
Антивирусная защита:
Устанавливайте и регулярно обновляйте антивирусное программное обеспечение. Такие программы помогут предотвратить вредоносные программы, которые могут быть использованы для кражи данных.
Бережное использование общественных сетей:
Остерегайтесь размещения чувствительной информации в социальных сетях. Эти данные могут быть использованы для взлома к вашему аккаунту и дальнейшего обнала карт.
Уведомление банка:
Если вы заметили подозрительные операции или утерю карты, свяжитесь с банком незамедлительно для блокировки карты и предотвращения финансовых потерь.
Образование и обучение:
Относитесь внимательно к новым способам мошенничества и постоянно обучайтесь тому, как избегать подобных атак. Современные мошенники постоянно совершенствуют свои методы, и ваше осведомленность может стать определяющим для защиты.
В завершение, соблюдение основных норм безопасности при использовании интернета и постоянное обновление знаний помогут вам минимизировать риск стать жертвой обнала карт на месте работы и в будней жизни. Помните, что ваша финансовая безопасность в ваших руках, и проактивные меры могут обеспечить ваш онлайн-опыт максимальной защитой и надежностью.
Heya i’m 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.
Hello! I know this is kind of off topic but I was wondering hich blog platform
are you using for this site? I’m getting sick and tired of WordPress
because I’ve had problems with hackers and I’m looking att alternatives for another platform.
I would be great if you could point me in the direction of a good platform.
Also visit my site: azadpur call girls agency
hi!,I like your writing very a lot! percentage we keep up a correspondence more
approximately your post on AOL? I require an expert in this area
to unravel my problem. May be that is you! Taking a look ahead to look you.
Thanks for one’s marvelous posting! I quite enjoyed reading it, you could be a great author.I
will be sure to bookmark your blog and will eventually come back down the road.
I want to encourage you to definitely continue your great work, have a nice afternoon!
Hey this is kinda of off topic but I was wondering if blogs use WYSIWYG
editors or if you have to manually code with HTML. I’m starting a
blog soon but have no coding knowledge so I wanted to get guidance from someone
with experience. Any help would be enormously
appreciated!
Here is my homepage; 릴게임사이트
When some one searches for his vital thing,
thus he/she wants to be available that in detail, therefore that thing is maintained
over here.
Cardsharing, também conhecido como CS, é uma técnica usada
para compartilhar um cartão de assinatura de TV a
cabo ou satélite entre vários usuários, utilizando uma conexão de rede.
Isso permite que pessoas que não possuem uma assinatura
legítima acessem conteúdo pago, como canais de TV a cabo ou satélite, por meio de um único cartão de assinatura compartilhado.
Usualmente, um dispositivo, conhecido como servidor de cardsharing, hospeda o cartão de assinatura e
o compartilha através da internet com dispositivos clientes, que
podem estar em locais diferentes.
Hey There. I found your log using msn. This is a really well written article.
I will make sure to bookmark it and come back to read more of your
useful information. Thanks foor the post. I will certainly comeback.
Also visit my web blog :: Massage Forum (https://www.massagebbs.com/)
You actually expressed it well.
Feel free to visit my webpage; https://www.thepurplefox.co.uk
hello!,I like your writing so a lot! proportion we communicate
extra approximately your post on AOL? I need
an expert in this space to resolve my problem. May be that is you!
Taking a look ahead to look you.
I absolutely love your site.. Excellent colors & theme.
Did you develop this wweb site yourself? Please
relly back as I’m looking to create myy own blog and want
to find out where youu got this from orr exactly what the theme is called.
Kudos!
My web site … belgia praca dla par
Excellent post. I was checking constantly this blog and I am inspired!
Very helpful info specially the remaining phase 🙂 I deal with such information much.
I was seeking this particular info for a long time. Thank you and good luck.
Superb, what a blog it is! This blog provides valuable
information to us, keep it up.
Hello this is somewhat of off topic but I was wondering if blogs use WYSIWYG editors or if you have to manually code with HTML.
I’m starting a blog soon but have no coding know-how so I wanted
to get advice from someone with experience.
Any help would be greatly appreciated!
Appreciate the recommendation. Will try it out.
Hello, all the time i used to check web site posts here in the early hours in the break of day,
because i enjoy to gain knowledge of more and more.
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.
обнал карт форум
Обнал карт: Как обеспечить безопасность от хакеров и обеспечить защиту в сети
Современный общество высоких технологий предоставляет возможности онлайн-платежей и банковских операций, но с этим приходит и повышающаяся опасность обнала карт. Обнал карт является процессом использования украденных или неправомерно приобретенных кредитных карт для совершения финансовых транзакций с целью маскировать их происхождения и заблокировать отслеживание.
Ключевые моменты для безопасности в сети и предотвращения обнала карт:
Защита личной информации:
Соблюдайте осторожность при предоставлении личной информации онлайн. Никогда не делитесь банковскими номерами карт, пин-кодами и дополнительными конфиденциальными данными на сомнительных сайтах.
Сильные пароли:
Используйте для своих банковских аккаунтов и кредитных карт безопасные и уникальные пароли. Регулярно изменяйте пароли для усиления безопасности.
Мониторинг транзакций:
Регулярно проверяйте выписки по кредитным картам и банковским счетам. Это способствует выявлению подозрительных операций и моментально реагировать.
Антивирусная защита:
Утанавливайте и актуализируйте антивирусное программное обеспечение. Такие программы помогут защитить от вредоносных программ, которые могут быть использованы для похищения данных.
Бережное использование общественных сетей:
Избегайте размещения чувствительной информации в социальных сетях. Эти данные могут быть использованы для несанкционированного доступа к вашему аккаунту и дальнейшего обнала карт.
Уведомление банка:
Если вы выявили подозрительные действия или потерю карты, свяжитесь с банком сразу для блокировки карты и избежания финансовых ущербов.
Образование и обучение:
Будьте внимательными к новым методам мошенничества и постоянно обучайтесь тому, как предотвращать подобные атаки. Современные мошенники постоянно разрабатывают новые методы, и ваше знание может стать определяющим для защиты
Hello, i read your blog occasionally and i own a similar one and i was just curious if you
get a lot of spam comments? If so how do you reduce it, any plugin or anything you can advise?
I get so much lately it’s driving me crazy so any help is very much appreciated.
Here is my site; 우리카지노
Very nice article, just what I needed.
My homepage :: 릴게임
It’s wonderful that you aare getting thoughts from this piece off writing ass well as from our discussion made at this time.
Here is my homepage: escort serice Kulgam (Donnell)
This paragraph will assist the internet viewers for setting up new blog or even a weblog from start to end.
Feel free to visit my page MPO007 LOGIN
Its like you read my mind! You seem to know a lot about this, like you wrote the book in it or
something. I think that you could do with some pics to drive the message
home a little bit, but other than that, this is great blog.
A great read. I’ll certainly be back.
My website … austin copiers
Great site you have here but I was curious if you knew of any forums that cover the
same topics talked about in this article? I’d
really love to be a part of group where I can get responses from other experienced people that share the
same interest. If you have any suggestions, please let me
know. Thank you!
https://roommx.com/