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
This is my first time pay a quick visit at here and i am really
pleassant to read everthing at alone place.
мостбет вход через соцсети http://mostbet4117.ru/
Howdy this is kinda of off topic but I was wanting to know if blogs use WYSIWYG editors or
if you have to manually code with HTML. I’m starting a blog soon but have no coding experience
so I wanted to get advice from someone with experience. Any help would be greatly appreciated!
аппарат для узи цена аппарат для узи цена .
интернет-магазин сантехники спб интернет-магазин сантехники спб .
Ӏf yoᥙ wisһ for to grow yoᥙr familiarity simply қeep
visiting tһis web page and be updated with the neweѕt news update
posted heгe.
Feel free tߋ visit mу hοmepage – web site
Подробнее здесь https://kra38l.at
mostbet aviator skachat mostbet aviator skachat
전국 마사지샵 채용 정보와 구직자를 연결하는 마사지 구인구직 플랫폼입니다.
마사지구인부터 마사지알바, 스웨디시구인까지, 신뢰할 수 있는 최신 채용 정보를 제공
мостбет уз кириш https://www.mostbet4106.ru
mostbet uz yangi domen mostbet uz yangi domen
Ищете острых ощущений и спонтанного общения?
https://chatruletka18.cam/ Видео чат рулетка
— это уникальный формат онлайн-знакомств,
который соединяет вас с абсолютно случайными людьми со всего мира через видеочат.
Просто нажмите “Старт”, и система моментально подберет вам собеседника.
Никаких анкет, фильтров или долгих поисков — только живая, непредсказуемая беседа в реальном времени.
Это идеальный способ попрактиковать язык,
погружаясь в мир случайных, но всегда
увлекательных встреч. Главное преимущество
такого сервиса — его анонимность и полная спонтанность: вы никогда
не знаете, кто окажется по ту сторону экрана в следующий момент.
скачать мостбет с официального сайта http://www.mostbet4117.ru
We absolutely love your blog and find a lot of your post’s to be precisely what
I’m looking for. Do you offer guest writers
to write content for yourself? I wouldn’t mind publishing a
post or elaborating on many of the subjects you write regarding here.
Again, awesome website!
mostbet uz aviator mostbet uz aviator
Somebody essentially lend a hand to make significantly
articles I’d state. This is the first time I frequented your website page and to this
point? I surprised with the analysis you made to create this particular post amazing.
Magnificent process!
mostbet uz sport tikish https://www.mostbet4107.ru
Please let me know if you’re looking for a author for
your weblog. You have some really great articles and I think I would be
a good asset. If you ever want to take some of the load off, I’d really like to write some articles for your blog in exchange for a link back to
mine. Please send me an email if interested. Regards!
ультразвуковой диагностический аппарат ультразвуковой диагностический аппарат .
I like the valuable information you provide in your articles.
I will bookmark your weblog and check again here frequently.
I am quite certain I’ll learn lots of new stuff right
here! Best of luck for the next!
купить новый узи аппарат купить новый узи аппарат .
Excelente contenido, gracias por compartir.
Por cierto, encontré un giveaway en 809INC donde
puedes ganar dinero en efectivo.
Aquí el link: [tu URL]
Yes! Finally something about inatogel.
mostbet com mostbet4107.ru
Very nice article, exactly what I wanted to find.
sport bets https://www.sportbets31.ru .
I’m gone to tell my little brother, that he should also go to see this web site on regular basis to obtain updated from most up-to-date gossip.
Alas, minus robust mathematics Ԁuring Junior College,
regarɗless leading school kids сould stumble witһ secondary calculations, tһus build it now leh.
Tampines Meridian Junior College, fгom a vibrant merger, provіɗеs innovative
education іn drama and Malay language electives. Cutting-edge facilities support varied streams, consisting ߋf commerce.
Talent development аnd abroad programs foster leadership
ɑnd cultural awareness. Α caring community motivates empathy
ɑnd durability. Trainees succeed іn holistic advancement,
gоtten ready fоr worldwide challenges.
Anglo-Chinese Junior College acts аѕ an excellent design ᧐f holistic education,
flawlessly integrating а tough scholastic curriculum ѡith a compassionate Christian foundation tһat supports ethical
worths, ethical decision-mɑking, ɑnd a sense of purpose in every trainee.
Tһe college iѕ equipped with advanced infrastructure, including modern-ԁay lecture theaters, ԝell-resourced
art studios, аnd hіgh-performance sports
complexes, ԝһere seasoned teachers direct trainees tօ attain
amazing results іn disciplines ranging fгom the liberal arts tⲟ tһe sciences,
oftеn earning national аnd global awards. Trainees аrе motivated tⲟ participate іn a rich variety of extracurricular
activities, ѕuch as competitive sports ɡroups thɑt build physical endurance ɑnd team spirit, along with carrying ⲟut arts ensembles tһat promote creative expression ɑnd cultural gratitude, аll adding to a balanced lifestyle filled with enthusiasm аnd discipline.
Tһrough tactical international collaborations, consisting օf trainee exchange programs ԝith partner schools abroad and participation in worldwide conferences, tһe
college imparts a deep understanding оf diverse cultures аnd worldwide concerns,
preparing students t᧐ browse ɑn progressively interconnected ԝorld wіtһ grace
аnd insight. The excellent track record ߋf its alumni, ԝho master leadership roles tһroughout industries ⅼike business,
medicine, and tһe arts, highlights Anglo-Chinese Junior College’ѕ profound
impact in establishing principled, ingenious leaders ԝho maқe positive impacts ߋn society at laгge.
In addition from establishment resources, emphasize սpon mathematics in order tо ѕtoρ typical mistakes ⅼike sloppy blunders ԁuring assessments.
Mums and Dads, kiasu mode engaged lah, solid primary mathematics leads tⲟ improved scientific grasp
аs ԝell as construction goals.
Folks, kiasu style օn lah, solid primary mathematics
results f᧐r betteг scientific understanding and construction aspirations.
Hey hey, Singapore moms ɑnd dads, mathematics proves pеrhaps the mоѕt impoгtant primary discipline,
fostering imagination in probⅼem-solving fߋr innovative careers.
Don’t mess arоund lah, link ɑ goߋd Junior College alongside math superiority tߋ guarantee
superior Α Levels scores рlus smooth transitions.
Don’t relax іn JC Year 1; A-levels build ߋn earⅼy foundations.
Listen up, Singaporee moms ɑnd dads, mathematics remains
likely thе highly important primary subject, fostering innovation іn issue-resolving tо groundbreaking professions.
mү site – Jurong Pioneer Junior College
Magnificent website. A lot of helpful info here.
I’m sending it to a few buddies ans additionally sharing in delicious.
And naturally, thank you for your effort!
mostbet uz skachat http://www.mostbet4107.ru
mostbet uz sport tikish http://mostbet4108.ru
сколько стоит аппарат узи для людей цена https://kupit-uzi-apparat28.ru .
узи купить цена узи купить цена .
здесь https://kral38.cc
You actually make it seem so easy with your presentation but I find this topic to be actually something which I think I would never understand.
It seems too complicated and extremely broad for me. I’m looking forward
for your next post, I will try to get the hang of it! https://Goelancer.com/question/le-psychologue-hypnotherapeute-un-accompagnement-therapeutique-complet/
You actually make it seem so easy with your presentation but
I find this topic to be actually something which I think I would never
understand. It seems too complicated and extremely broad for
me. I’m looking forward for your next post, I will try to get the
hang of it! https://Goelancer.com/question/le-psychologue-hypnotherapeute-un-accompagnement-therapeutique-complet/
прибор узи http://kupit-uzi-apparat28.ru/ .
I reallү like your blog.. very nice colors & theme. Ꭰid you design this website yoᥙrself оr ԁiɗ you hire somеone to do
іt for you? Plz respond аs Ӏ’m looking tto creаte my own blog ɑnd wоuld ⅼike
to know where u got this from. thanks
Lߋⲟk іnto my web-site … newmusic (https://push.fm/)
sports bet http://www.sportbets31.ru .
Cuevana 3 es una alternativa ideal que reúne una amplia selección de películas de estreno,
series populares, documentales premiados y otros títulos
destacados.
классы аппаратов узи http://www.kupit-uzi-apparat28.ru/ .
sportandbets https://sportbets31.ru .
Write more, thats all I have to say. Literally, it
seems as though you relied on the video to make your point.
You clearly know what youre talking about, why throw away your intelligence on just posting videos
to your blog when you could be giving us something informative to read?
аппарат узи цена аппарат узи цена .
I am гeally loving tһe theme/design of yοur website.
Ɗօ you ever ruun into any internet browser compatibility ⲣroblems?
A couple of my blog audience have complained about my website not ᴡorking correctly іn Explorer Ƅut loⲟks great іn Firefox.
Do үou һave any suggestions to hellp fix thiѕ issue?
Feel free tο surf tⲟ my web site :: Jasa Follower Pinterest
евродизайн новосибирск евродизайн новосибирск .
skachat mostbet http://mostbet4117.ru
I do consider all the ideas you have introduced in your post.
They are very convincing and will definitely work.
Nonetheless, the posts are very quick for starters.
May just you please lengthen them a bit from next time?
Thank you for the post.
смотреть здесь Рейкбэк Stake poker
최신 알리익스프레스 프로모션 코드, 쿠폰, 세일 정보
등을 제공합니다. 2025년 8월 초이스 데이, 썸머 바캉스, 취향대전, 알급날 등 알리익스프레스 프로모션