First, put the script on multiple lines; much easier to read. Second, set bash env var IFS to newline eg
http://ubuntuforums.org/showthread.php?t=820403
Code:
# set IFS to newline only; default is space or tab or newline
IFS=$'\n'
for i in $(cat passwords )
do
for j in $(cat passwords )
do
echo ${i} ${j}
done
done
Note that if you need to reset the IFS during the script, save the old value away to a var and re-assign as reqd.
When the script finishes, IFS will of course be whatever the calling shell value was; it doesn't get changed unless you source the script or run it directly at the cli.