hello all
I'm writing a bash script and I need to read data from a file line by line
The number of words of each line is not known and I want to check if anywhere
in the line exists the substring www..That substring is a string by itself
or a substring of other strings.So what I tried so far is:
while read line;
do
stringtocheck=($line)
echo $stringtocheck
if [[ "$stringtocheck" == *www.* ]]
then
//do things
fi
done < './tempfile'
But it only saves in the variable stringtocheck the first word of the line..
Instead I want the whole line.What shoud I do in this case?