Quote:
Originally posted by foo_bar_foo
~/clean $ ls -l out
lrwxrwxrwx 1 user users 5 2005-02-13 22:42 out -> a.out
cp --no-dereference out ./test
cp a.out ./test
cd ./test
~/clean/test $ ls -l
-rwxr-xr-x 1 user users 8334 2005-02-13 22:47 a.out
lrwxrwxrwx 1 user users 5 2005-02-13 22:47 out -> a.out
if it gets more complex with long paths that need changing then just rm the link copy te file
and rebuild the link with ln -s
|
Thanks for sharing your idea.
But the point is...how do i do it by script program?
Just take your code as example:
Code:
usage:super_cp file destination
in the script , we could know if file link to other or not.
copy it / them to the destination.
(Moreover , I find sometimes there's soft link to anohter soft link file!)