I am trying to read through dotfile repos in order to learn how to maintain my own dotfiles. Here is an example that I am looking at:
pushd homedir > /dev/null 2>&1
for file in .*; do
if [[ $file == "." || $file == ".." ]]; then
continue
fi
# make backup
# ...
# ...
# create the new link
ln -s ~/.dotfiles/homedir/$file ~/$file
echo -en '\tlinked';ok
done
popd > /dev/null 2>&1
Why is
.*
used to iterate over the files in homedir.Is the following if-statement necessary account for the fact that .* expands to
.
and..
and therefore would include files outside of working dir?