What error are you getting?
Just by looking at what you posted, you might try:
Code:
cat db.txt | while read db something_else; do
if [ $db = "expected" ]; then
echo "$something_else"
else
echo "Nope"
fi
done
This won't work with all shells, though. Most likely, it will work with ksh and zsh, but not sh or bash. Also, you can remove the "cat" at the beginning, and redirect the file into done: