From: Christian Heller Date: Tue, 13 Nov 2018 22:24:32 +0000 (+0100) Subject: Improve symlink script. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/static/git-favicon.png?a=commitdiff_plain;h=ce883f56c6285d25f0dc50584e39dbebff7a77f9;p=config Improve symlink script. --- diff --git a/all_new_2018/symlink_etc.sh b/all_new_2018/symlink_etc.sh index 9a7a162..edee563 100755 --- a/all_new_2018/symlink_etc.sh +++ b/all_new_2018/symlink_etc.sh @@ -14,7 +14,9 @@ fi config_tree_prefix="${HOME}/config/all_new_2018/linkable_etc_files/" cd "${config_tree_prefix}""${target}" for path in $(find . -type f); do - src=$(echo "${path}" | cut -c2-) - dest=$(realpath "${path}") - ln -fs "${dest}" "${src}" + linking=$(echo "${path}" | cut -c2-) + linked=$(realpath "${path}") + dir=$(dirname "${linking}") + mkdir -p "${dir}" + ln -fs "${linked}" "${linking}" done