ln -s ad.1 /man/man1/active-dir # /man/man1/: active-dir -> ad.1
We now have a broken link since ad.1
isn't a valid path from within man1/
,
ln stores the path we give literally, without any check
Solution: use ~/ad.1
which is resolvable from within man1/
ln -sT ~/ad.1 /man/man1 # /man/: man1 -> ~/ad.1
Race condition: if man1/
gets created before ln finishes, ensure ln fails, we don't want a link inside man1/
ln -st /man/man1/ ~/ad.1 # /man/man1/: ad.1 -> ~/ad.1
Race condition: if man1/
gets deleted before ln finishes, ensure ln fails, we don't want a link named man1