Using bash to automate dotfiles
Give this a try:
ln -s ~/dotfiles/* ~
There shouldn't be any need for a loop. Of course, you can use find
if you need something recursive.
Edit:
To make the destination files hidden:
for f in ~/dotfiles/*
do
ln -s "$f" "$HOME/.${f##*/}"
done