2 # Symbolically link files to those in argument-selected subdirectories
3 # of linkable_etc_files//, e.g. link /etc/foo/bar to
4 # linkable_etc_files/$1/etc/foo/bar and so on. Create directories as
6 # CAUTION: This removes original files at the affected paths.
9 config_tree_prefix="${HOME}/config/all_new_2018/linkable_etc_files/"
11 for target in "$@"; do
12 cd "${config_tree_prefix}${target}"
13 for path in $(find . -type f); do
14 linking=$(echo "${path}" | cut -c2-)
15 linked=$(realpath "${path}")
16 dir=$(dirname "${linking}")
18 ln -fs "${linked}" "${linking}"