0

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
  1. Why is .* used to iterate over the files in homedir.

  2. Is the following if-statement necessary account for the fact that .* expands to . and .. and therefore would include files outside of working dir?

oguz ismail
  • 1
  • 16
  • 47
  • 69
molleweide
  • 39
  • 1
  • 7

0 Answers0