1836636 Members
1519 Online
110102 Solutions
New Discussion

script - ignore case

 
SOLVED
Go to solution
Ravinder Singh Gill
Regular Advisor

script - ignore case

while I am doing the following grep I want it to ignore the case, I do not want to change the case so that they are all lowercase etc. What options/command do I need so that it ignores the case?

while read fakeuser
do
grep $fakeuser passgvts | awk -F":" '{print $1}' >> queryusers
done < testnotokusers
cat queryusers | sort | uniq > newfile
7 REPLIES 7
Ravinder Singh Gill
Regular Advisor

Re: script - ignore case

any ideas guys?
Peter Godron
Honored Contributor
Solution

Re: script - ignore case

grep -i ?
Jakes Louw
Trusted Contributor

Re: script - ignore case

grep -i
Trying is the first step to failure - Homer Simpson
Arunvijai_4
Honored Contributor

Re: script - ignore case

Hello,

while read fakeuser
do
grep -i $fakeuser passgvts | awk -F":" '{print $1}' >> queryusers
done < testnotokusers
cat queryusers | sort | uniq > newfile

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Muthukumar_5
Honored Contributor

Re: script - ignore case

Use as,

while read fakeuser
do
grep -i "${fakeuser}" passgvts | awk -F":" '{print $1}' >> queryusers
done < testnotokusers

sort queryusers | uniq > newfile

--
Muthu
Easy to suggest when don't know about the problem!
Arturo Galbiati
Esteemed Contributor

Re: script - ignore case

Hi,
grep -i to ignorecase.
HTH,
Art
Ravinder Singh Gill
Regular Advisor

Re: script - ignore case

Thanks