http://www.debian-administration.org/articles/150

skx@lappy:~$ for i in *.JPG; do echo $i; done
a.JPG
b.JPG
c.JPG
d.JPG

for i in *.jpg; do mv “$i” “`basename $i .jpg`.JPG”; done

for i in $(seq 1 100); do echo -n “file${i} “; touch file${i} 2>&1; done

The the above for loop will create 100 files (called file1, file2, etc.).

Now I have many websites in a list file “block.list”, and would like to have the script pass them one by one in a for loop… How would I accomplish that in a bash script?

something of the general form below:

for x in ???block.list???
do
iptables -A OUTPUT -d $x -j DROP;
done

http://www.panix.com/~elflord/unix/bash-tute.html

operator produces true if… number of operands
-n operand non zero length 1
-z operand has zero length 1
-d there exists a directory whose name is operand 1
-f there exists a file whose name is operand 1
-eq the operands are integers and they are equal 2
-neq the opposite of -eq 2
= the operands are equal (as strings) 2
!= opposite of = 2
-lt operand1 is strictly less than operand2 (both operands should be integers) 2
-gt operand1 is strictly greater than operand2 (both operands should be integers) 2
-ge operand1 is greater than or equal to operand2 (both operands should be integers) 2
-le operand1 is less than or equal to operand2 (both operands should be integers) 2

http://www.linuxconfig.org/Bash_scripting_Tutorial