I have makefile containing code below.
ddd :
@mkdir -p /full/path_new/to/new_dir
@ln -fs /full/path_old/to/old_dir/private /full/path_new/to/new_dir/private
Linux ln command creates link in both directory taget and parent. It means I have:
/full/path_new/to/new_dir:
private -> /full/path_old/to/old_dir/private
but also old one gets link
/full/path_old/to/old_dir/private
private -> /full/path_old/to/old_dir/private
It cause I have something like
/full/path_old/to/old_dir/private/private/private/private (...) endless
How should I use ln command to have link in new_dir only?
You need to remove the existing link before you create it: