I am trying to write a shell script to create link for file from my dotfiles
repo to my home folder.
I want to use hard link if possible because it cannot be broken when moving it to somewhere in the same filesystem with HOME
.
But if I clone the dotfiles
to another filesystem, I have to use symlink instead.
So, how to create hard link for file if possible, else use symlink in shell script?