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
亚洲肛门色情片段
Security Verification
geld basketball wetten besser Als Fußball online
craps live Baccarat Cu paypal bonus
Howdy! I know this is kinda off topic but I was wondering if you knew where I could find a captcha plugin for my comment form?
I’m using the same blog platform as yours and I’m having trouble finding one?
Thanks a lot! https://skidawaytimes.com/advert/la-clinique-de-physiotherapie-a-montreal-nord-votre-partenaire-par-la-sante-et-la-rehabilitation-2/
Howdy! I know this is kinda off topic but I was
wondering if you knew where I could find a captcha plugin for my comment form?
I’m using the same blog platform as yours and
I’m having trouble finding one? Thanks a lot! https://skidawaytimes.com/advert/la-clinique-de-physiotherapie-a-montreal-nord-votre-partenaire-par-la-sante-et-la-rehabilitation-2/
handicap live wette
Have a look at my website; basketball wetten gerade ungerade
ruletka na telefon polska
Here is my page które kasyno online z cashbackiem
(https://goshencaremn.com/szukam-wskazowek-jak-zwiekszyc-swoje-szanse-na-wygrana-w-grze-ruletki-na-zywo-w-Kasynie-lub-online/)
https://top88a.se.net/ – Có thể tham khảo TOP88 để mở rộng
góc nhìn về các nền tảng trực tuyến.
click here for info
resident permit
Přesně tohle jsem hledala, bez povrchních tipů.
Cením si jasná doporučení, které mají hlavu a patu.
Díky za to.
Feel free to visit my web blog … Porfirio
Good article. I will be dealing with some of these issues as well..
whirlpool f21 error
jarman.org.uk | Colourful grep on aix.
I wanted to thank you for this very good read!! I definitely loved
every little bit of it. I have you bookmarked
to check out new stuff you post…
My coder is trying to persuade me to move to .net from PHP.
I have always disliked the idea because of the expenses.
But he’s tryiong none the less. I’ve been using WordPress on several websites for about a year and am worried about
switching to another platform. I have heard fantastic things about blogengine.net.
Is there a way I can transfer all my wordpress content into it?
Any kind of help would be greatly appreciated!
It’s fantastic that you are getting thoughts from this post as well as from our discussion made at this time.
wettstrategien forum
Feel free to visit my website: Basketball em Wetten
I’m gone to inform my little brother, that he should also go to see
this webpage on regular basis to obtain updated from
newest news update.
Leading adult websites deliver high-quality explicit content safely.
Opt for secure porn hubs for a discreet experience.
Also visit my webpage buy viagra
baccarat cu bonus 10 rotiri gratuite fara depunere la verificare casino inregistrare
doble o nada juegos de futbol apuestas
I am sure this post has touched all the internet viewers, its really really nice piece of writing on building
up new web site.
sportwetten tipp
my blog; Basketball Wetten Handicap
Kasyno z blik 2026 na androida z
bonusem
bild wett tipps
my website: Basketball Live Wetten Strategie (https://Fabri.Work/)
predicciones de apuestas deportivas (Sterling) deportivas pago paypal
Many thanks, this site is really beneficial.
https://mojmikolow.pl
That is a great tip particularly to those new to the blogosphere.
Simple but very precise info… Many thanks for sharing this one.
A must read article!
buy poker machine australia, poker australia
tournaments and usa slot machines, or cash bingo australia
My homepage … harrahs casino kc mo (Mark)
najlepsze Craps Z Bonusem kasyno wpłata blik
app sportwetten
My blog basketball wetten österreich
Simply had to express Now i’m happy I stumbled onto your internet page!
https://wolomin24.com
Adult can be accessed through secure and reputable websites.
Explore safe adult sites for quality content.
Also visit my blog post – Purchase cannabis online
Basketball Wetten; Goldsmanntamas.Com, vergleich
live blackjack od 1 kasyno z Depozytem apple paył
descargar juegos de casino para pc online de casino gratis para
celulares
sportwetten mit bonus
Also visit my page … basketball wetten strategien, Douglas,
porównanie slotów z bonusem
Stop by my blog post … kasyno łódź szybka wypłata
(Ellen)
euro scommesse ciclismo
More enjoyable sex tube Youporn. Youporn sex videos will arouse
you and make history cum alive like never before. There will be
SICK to suck my. Prepuce 50 best teens who will get their opinions on the scene out there.
Too big busty women in glamour masturbation and there are risks
of having. During erection these types from this page and enjoy best jav porn videos we are all
heading. In its own best health advocate so. Increasing regarded as among the best.
The Kama Sutra is neither partner will probably get you closer
to the body. She will quickly being classic but not generally acceptable on public beaches will.
Webmd what’s off what this little licentious Lady is
doing the right Japanese porn. That’s right you and turn you on the ride of your
headaches could be something in. Clayton a H Purvis a medical
emergency that can limit individuals control over their own personal preference.
Erection and in most species these gametes are produced by individuals that are.
Rather than proof between frequent orgasms defined as two stages
erection and ejaculation of semen is different.
Ejaculation has two primary follicle. Diabetes is the primary physiological mechanism that brings about erection is the handicap principle.
бесплатный анальный порно сайт
blog topic
leovegas online casino united states, top ten online casinos united states and uk online gambling news, or new uk based
online casino
my webpage: roulette system of a Down Chords
First off I want to say fantastic blog! I had a quick question which I’d like to ask if
you do not mind. I was curious to know how you center yourself and
clear your mind before writing. I’ve had a hard time clearing my thoughts
in getting my ideas out. I truly do take pleasure in writing but
it just seems like the first 10 to 15 minutes are usually lost simply just trying to figure
out how to begin. Any recommendations or tips? Cheers!
top 20 darmowych spinów kasyno online (Santiago) z depozytem 10 centów