-target="$1"
-config_tree_prefix="~/config/all_new_2018/linkable_etc_files/"
-cd "$config_tree_prefix""$target"
-for path in $(find .); do
- dest=$(echo "$path" | cut -c2-)
- ln -fs "$path" "$dest"
+config_tree_prefix="${HOME}/config/all_new_2018/linkable_etc_files/"
+
+for target in "$@"; do
+ cd "${config_tree_prefix}${target}"
+ for path in $(find . -type f); do
+ linking=$(echo "${path}" | cut -c2-)
+ linked=$(realpath "${path}")
+ dir=$(dirname "${linking}")
+ mkdir -p "${dir}"
+ ln -fs "${linked}" "${linking}"
+ done