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
мостбет официальный сайт узбекистан http://mostbet4107.ru
sports bet sportbets31.ru .
I believe this is one of the such a lot important info for me.
And i’m happy reading your article. But wanna remark on few common things, The site style is great, the articles is actually
excellent : D. Just right job, cheers
My web site http://Inginformatica.Uniroma2.it/?URL=drpangplus.com%2Fbbs%2Fboard.php%3Fbo_table%3Dfree%26wr_id%3D591342/
mostbet ios https://mostbet4107.ru
sport bets sportbets31.ru .
І enjoy, lead tο I found еxactly what I ԝas looking
f᧐r. You’ѵe ended my 4 dаy lengthy hunt! God Bless уоu man. Have а great day.
Bye
Taкe a ⅼoоk att mү webzite Beli Subscriber Youtube
sport bets http://www.sportbets31.ru/ .
As the admin of this site is worҝing, no doubt verу shortly it will be renowned, duе to itѕ feature contents.
My webpage; Beli View Youtube
I needed to thank you for this excellent read!!
I definitely enjoyed every bit of it. I have
got you bookmarked to check out new stuff you post…
М. Фасмер ; пер. с нем. и https://https://apteka-herb.ru// доп.
мостбет. http://www.mostbet4107.ru
mostbet ilovasi ilova haqida baho 4 8 allaqachon yuklab olingan http://mostbet4107.ru
mostbet aviator strategiyasi http://mostbet4107.ru/
mostbet aviator strategiyasi mostbet4108.ru
мостбет. https://www.mostbet4106.ru
wonderful submit, very informative. I’m wondering why the
other specialists of this sector do not understand this.
You should continue your writing. I’m confident, you have
a huge readers’ base already!
This website was… how do I say it? Relevant!! Finally I’ve found something which helped
me. Cheers!
mostbet apk 2025 http://mostbet4106.ru
sport bets http://www.sportbets31.ru .
mostbet мостбет http://www.mostbet4118.ru
sports bet http://www.sportbets31.ru .
When it comes to online entertainment options, nothing really compares to playing slot games at a digital casino.
As internet gaming grows rapidly, users can now enjoy hundreds of online slot
games right from their mobile or desktop.
If you love retro-style fruit machines or video slots packed with bonus features and free spins, there’s something for everyone.Another factor contributing to their appeal is the simplicity of gameplay.
Unlike table games like baccarat or roulette, you can just spin and enjoy.
Set your wager, spin the reels, and wait for the outcome.
It’s all about chance, fun, and maybe landing a jackpot.
Want to know more before playing?, this article breaks it all down really well
about how online slot machines work. It explores
how slot algorithms function and what to expect as a new player.
Definitely worth a read before you spin. Read the full article here:
[insert article URL].
Overall, online casino slots are an accessible and thrilling way to experience gambling.
Just remember, always play within your limits and have fun. Best of luck
on the reels!
казино мостбет скачать https://www.mostbet4118.ru
интернет-магазин сантехники с доставкой по россии http://evropejskaya-santehnika2.ru/ .
Estuve buscando sitios para jugar online y me topé con https://hikvisiondb.webcam/wiki/User:PilarEberhardt6, y la verdad que me funcionó mejor de lo que esperaba. El login es bastante directo, sin tener que verificar cien cosas. La versión para el móvil me anda sin tirones, incluso en un Android que ya tiene sus años. Se nota que no es un copia-pega de la web, no como otras que te sacan de la partida cada rato. El tema del bono Spinmama también suma. No es una de esas promos que solo sirven para engañar, acá se aplica solo al registrarte y es útil para empezar. Y lo mejor: después siguen tirando beneficios cada tanto, no es solo una vez y ya. Además, algo que me gustó es que el soporte está en español, y cuando me trabé con una promo, me resolvieron el tema sin drama. En resumen, si alguien anda buscando algo que valga la pena, yo diría que es de lo mejorcito que probé últimamente. No digo que sea perfecto, pero por ahora vengo contento.
mostbet promo kodni kiritish http://www.mostbet4108.ru
mostbet uz kirish skachat http://www.mostbet4107.ru
most-bet most-bet
мостбет промокод на бонус мостбет промокод на бонус
унитаз алина байкова унитаз алина байкова .
mostbet live mostbet live
Awesome write ups, Many thanks.
Also visit my webpage :: http://madk-auto.ru/user/JennieBleau3853/
I have been browsing online more than 4 hours today, yet I never found any interesting
article like yours. It is pretty worth enough for me.
In my view, if all web owners and bloggers made good content as you did, the web will be much more useful than ever before.
Someone essentially help to make significantly
posts I might state. This is the first time I frequented your website page and thus far?
I surprised with the analysis you made to create this
actual publish amazing. Fantastic job!
mosbet.uz https://mostbet4107.ru/
mostbet promo bilan ro‘yxatdan o‘tish https://mostbet4107.ru
мостбет казино войти mostbet4118.ru
I’m truly enjoying the design and layout of your website.
It’s a very easy on the eyes which makes it much more enjoyable for me to come
here and visit more often. Did you hire out a developer to create your theme?
Excellent work!
salle a manger
jarman.org.uk | Colourful grep on aix.
интернет магазин сантехники спб http://www.evropejskaya-santehnika2.ru/ .
интернет магазины сантехники evropejskaya-santehnika2.ru .
магазин сантехники дизайн evropejskaya-santehnika2.ru .
скачать мостбет официальный сайт скачать мостбет официальный сайт
унитаз алина байкова унитаз алина байкова .
Do you have a spam problem on this blog; I also am a blogger, and
I was wanting to know your situation; many of us have created some
nice procedures and we are looking to trade solutions with other folks,
be sure to shoot me an e-mail if interested.
When it comes to ways to enjoy your free time on the internet, there’s hardly anything more
thrilling than playing slot games at a digital casino.
As internet gaming grows rapidly, players now have access to countless of virtual slot machines right from their
mobile or desktop. If you love retro-style fruit machines
or new-age slots with progressive jackpots, you’re spoiled for choice.One reason why slots dominate
online casinos is how easy they are to play.
Unlike poker or blackjack, you can just spin and enjoy. Choose your paylines, spin, and see
if luck’s on your side. It’s a game of luck that can be incredibly rewarding.
For those curious about how to get started, this
article breaks it all down really well about understanding online slot odds and RTP.
It dives into things like payout percentages, game
mechanics, and tips for beginners. Highly recommended if you’re serious about playing smart.
Check it out at this link: [insert article URL].
All in all, online casino slots are an accessible and thrilling way to experience gambling.
Make sure to manage your bankroll wisely and enjoy the
ride. Good luck and happy spinning!
интернет-магазин сантехники екатеринбург http://evropejskaya-santehnika2.ru/ .
mostbet скачать на андроид mostbet скачать на андроид
Вик знакомит Алекса с Василисой, после чего у них начинается роман, https://https://suncity-club.ru// которому хочет помешать Костя Мозг.
Awesome forum posts, Regards!