May 30, 2006 #1 keak Programmer Sep 12, 2005 247 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 Aug 8, 2002 3,186 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 Apr 18, 2005 3,165 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