# First use hardcoded values for the days - we'll see how to examine the file # and extract the days later. # This uses "i" for the name of the variable. The variable 'i' will contain # 20 on the first pass through the loop, then 21 on the next pass, 22 on the # next, etc. # Our script gets the value contained in this variable with the string '$i', # similar to the way we used $1 in the previous example. # # It's common practice to indent the lines in a loop to make it easy to see # where loops start and stop. for i in 20 21 22 23 24 25 26 27 do echo "There were `grep ' sshd\[' messages.1 | grep password | grep "Dec $i" | wc -l` Attacks On Dec $i" done