Skip to content

Instantly share code, notes, and snippets.

@Finkregh
Created April 7, 2023 16:46
Show Gist options
  • Save Finkregh/20b0f616b9503204d9147b17f2a03e6c to your computer and use it in GitHub Desktop.
Save Finkregh/20b0f616b9503204d9147b17f2a03e6c to your computer and use it in GitHub Desktop.

Revisions

  1. Finkregh created this gist Apr 7, 2023.
    13 changes: 13 additions & 0 deletions remove dotfile symlinks.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    # this expects your dotfiles in .dotfiles

    for l in $(
    for link in $(find . -type l); do
    if readlink "$link" | grep -q ".dotfiles"; then
    echo "$link"
    fi
    done
    ); do
    echo /bin/cp --remove-destination "$(realpath "$l")" "$l"
    done | tee symlinks-todo.sh

    # then look at symlinks-todo.sh and if content is ok run it