copy both soft link and its linked file
As title , if i wanna do it by bash script , how to do that?
For example , I want to copy /usr/lib/libfreetype.so to somewhere. But it is a soft link , linking to /usr/lib/libfreetype.6.3.2 What i desire is using a script to copy both of them to the destination and keeping its linking relation. === P.S. cp -L cp -av those two commands' parameter cannot satidfy me~ Best Regards, Diego |
~/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 |
Quote:
But the point is...how do i do it by script program? Just take your code as example: Code:
usage:super_cp file destination |
Quote:
But the point is...how do i do it by script program? Just take your code as example: Code:
usage:super_cp file destination |
All times are GMT -5. The time now is 10:49 AM. |