May 30, 2006 #1 keak Programmer Joined Sep 12, 2005 Messages 247 Location CA hi there, I am writing a shell script and I was wondering if I can prevent contents in softlinks to be copied over with the cp -r command? Also, is there a way in cp to copy all fiels except for a single file or directory ? Thanks!
hi there, I am writing a shell script and I was wondering if I can prevent contents in softlinks to be copied over with the cp -r command? Also, is there a way in cp to copy all fiels except for a single file or directory ? Thanks!
May 30, 2006 #2 SamBones Programmer Joined Aug 8, 2002 Messages 3,186 Location US In the Korn shell, if you want to copy all files except (for example) files ending with ".txt", do this... Code: cp !(*.txt) /destination/dir That "[tt]!(*.txt)[/tt]" will expand to everything BUT files ending in ".txt". Upvote 0 Downvote
In the Korn shell, if you want to copy all files except (for example) files ending with ".txt", do this... Code: cp !(*.txt) /destination/dir That "[tt]!(*.txt)[/tt]" will expand to everything BUT files ending in ".txt".
May 30, 2006 #3 p5wizard IS-IT--Management Joined Apr 18, 2005 Messages 3,165 Location BE Try cp -h -r src dest to recreate softlinks instead of copying the files that the softlinks point to... HTH, p5wizard Upvote 0 Downvote
Try cp -h -r src dest to recreate softlinks instead of copying the files that the softlinks point to... HTH, p5wizard