In the previous examples, we used the for loop to iterate over simple values where each value has no space.
As you know, if your values contain a space, you should use double quotes:
#!/bin/bash for var in one "This is two" "Now three" "We'll check four" do echo "Value: $var" done
As you can see, each value is printed as expected thanks to double quotes.
This example contains values in one line and we quote the values because they have spaces and commas. What if the values were on multiple lines, as in a file?
What if the separator between the values we want to iterate over is something other than a space such as a comma or a semicolon?
Here comes the IFS.