Richard van der Leeden wrote: > Copying everything apart from files ending in ~, and .scratch dirs and files > therein: > cp -rvf !(*~|.scratch) /tmp/dir2 > `file1' -> `/tmp/dir2/file1' > `file2' -> `/tmp/dir2/file2' > `file3' -> `/tmp/dir2/file3'
This is not doing quite what I think you think it is doing. Use 'echo' to show what arguments are being passed to the command. echo cp -rvf !(*~|.scratch) /tmp/dir2 I expect this to show that the shell has already expanded that shell file glob to match (or not match) the files in the current directory. Because the -r option is specified if one of those is a directory then the full contents of the directory will be copied recursively. This type of operation is much better done using the modular tools such as already posted by others. Bob _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
