duuuuuuuuuuuuuuuuuuuuuuuuh!
it was only because the manuals were confusing me. It says over and over again that you have to put strings in " " to make the shell use the whole line (otherwise it will only take the first word) but of course if i use the search command with " " it will search for
"word" not
word.....
echo 'Dont enclose seach criteria in ""''
echo
echo "Type place name"
read place
echo "Type class name"
read class
if [ -z "$place" ] || [ -z "$class" ]; then # checks if they have zero value
echo "You must enter both a place and a class name!"
echo "Finishing! try again"
exit # quits
fi # end of if function
grep "$sted" navneliste-1.txt | grep "$studie" # search for whatever was entered in the variables in the textfile called navneliste-1
# this will return all lines matching BOTH criteria
echo "Number of hits: "
grep "$sted" navneliste-1.txt | grep "$studie" | wc -l # returns number of hits given in search
" the | pipes the answer of the first function into the next one