I want to compare what the user enters to this text file, to determine if what they entered is in the text file or not, and then tell them.
file1: color_readme.txt in this file is:
red
red
orange
blue
code:
echo Please enter a color:
cat color_readme.txt (printing the colors to screen)
read userinput (read what the user enters)
variable1 = grep $userinput (a random variable = what is found in the file according to what the user typed)
if userinput = variable1 (SAY THIS)
else (SAY THIS)
What is the best way to do this for a beginner? My teacher only wants me using the basic if ifelse and else conditions.