unln - Convert a symbolic link to a copy of its target
unln -rshlopR file ...
For each symbolic link given by file, convert it to a copy of its target as follows:
If any specified file is not a symbolic link, then a warning is issued and a status of 1 is returned, unless file is a directory and the -R option is specified.
If expanding the link would result in a tree of infinite size because it contains a link to a parent directory, then such links are expanded only once, a warning is issued, and a status of 1 is returned. If a link cannot be expanded because it is self-referential, then it is not modified, a warning is issued, and a status of 1 is returned.
If -o is specified and neither -l nor -p is specified, then the
modifications of the filesystem made by this program, if successful, are
semantically imperceptable until a modification is made either through the
source or to the target of the original symbolic link, except that the
filesystem utilization is affected, the results of lstat(2) and readlink(2)
might be different, the dev, ino and ctime results of stat(2) might
be affected, and the directory obtained by appending /.. to the
source of the link might be different.
(There are probably a few other ways to tell the difference, but you get the
idea.)
If in the process of expanding the tree we discover a relative symbolic link whose target is unambiguously within the same tree, then that link is expanded as the corresponding node in the source tree rather than the target tree. In some cases, this makes the source tree independent of the target tree, such that the target tree can be safely removed.
If the program is interrupted or fails, then it will most likely leave behind a copy of its completed work in a file with a random suffix. This is probably a good thing because it might help you to figure out exactly what went wrong. However, it would be better if a message were generated to let you know what was left behind.