2 # Copy files to those in argument-selected subdirectories of
3 # linkable_etc_files//, e.g. copy /etc/foo/bar to
4 # linkable_etc_files/$1/etc/foo/bar and so on. Create directories as
7 # CAUTION: This removes original files at the affected paths.
10 config_tree_prefix="${HOME}/config/buster"
11 etc_files_dir="${config_tree_prefix}/etc_files"
13 for target in "$@"; do
14 cd "${etc_files_dir}/${target}"
15 for path in $(find . -type f); do
16 target=$(echo "${path}" | cut -c2-)
17 source=$(realpath "${path}")
18 dir=$(dirname "${target}")
20 cp "${source}" "${target}"