> The basic algorithm for to copy in a _file_ (not a directory, pipe, et al) is: > > read $i # actually, this is the cpio header data (inode info) for the > # file, which is followed in a cpio archive by the file itself > if [ -e $i ] > then rm -f $i ^^^^^ wait a second here! cpio is supposed to *copy* files, not *move* them. the man page repeatedly uses the word 'copy', and never mentions anything about 'delete'. > fi > cat input > $i # the file size is in the cpio header > > Note that in your last cpio example (the one where the file disappears), > your sources for the copy are also your target. ok. bad example. but it holds even when the source is in a tree adjacent to the current directory: chrome at steel:/var/tmp/test$ dir total 8.0k drwxr-xr-x 2 chrome chrome 4.0k Aug 5 08:13 ./ drwxrwxrwt 4 root root 4.0k Aug 5 06:26 ../ -rw-r--r-- 1 chrome chrome 0 Aug 5 08:12 file1 -rw-r--r-- 1 chrome chrome 0 Aug 5 08:13 file2 -rw-r--r-- 1 chrome chrome 0 Aug 5 08:13 file3 -rw-r--r-- 1 chrome chrome 0 Aug 5 08:13 file4 chrome at steel:/var/tmp/test$ cd - /var/tmp/try chrome at steel:/var/tmp/try$ find ../test/|cpio -padmuv . ./../test/ cpio: ../test/file1: No such file or directory cpio: ../test/file2: No such file or directory cpio: ../test/file3: No such file or directory cpio: ../test/file4: No such file or directory 0 blocks chrome at steel:/var/tmp/try$ dir /var/tmp/test/ total 8.0k drwxr-xr-x 2 chrome chrome 4.0k Aug 5 08:13 ./ drwxrwxrwt 4 root root 4.0k Aug 5 06:26 ../ Carl Soderstrom -- Network Engineer Real-Time Enterprises (952) 943-8700