Hey , i am trying to do a search for the certain books , and im trying to make it case insensitive. what i have come up with so far is this :
Database.txt
RETARDED MONKEY:RACHEAL ABRAHAML:30:30:20
GOLD:FATIN:23.20:12:3
STUPID:JERLYN:20:40:3
echo -n "Title: "
read Title
echo -n "Author:"
read Author
echo ""
valuecheck=`grep -i "$Title" Database.txt | grep -i "$Author" | awk -F":" '{ print $1}'`
echo $valuecheck
if [ $Title = $valuecheck ] ; then
echo "HOHOHO"
else
echo "too bad"
fi
the issue which i am having is that, when it does the search for the correct row to be inputted into valuecheck , it will input the value as written in the database, which is in Uppercase.
For this case, if i type in stupid for $Title and jerlyn for $Author, it searches the correct row, but the awk will print "STUPID" into the variable as that is what is written in the database.
so how can i make my if statement case insensitive? currently it reads like this
i
f [ $Title = $valuecheck ] ; then
which means
if [stupid = STUPID ] ; then
how can i make it case insensitive to allow it to display "HOHOHO"