#!/bin/rc # dcp src* dest # Deep copy all items _src*_ into directory _dest_. # Preserves permissions and ownership as far as # possible, behaving similarly to Gnu cp -a. # # This differs from dircp which deep-copies # the _contents_ of one directory into another. if ( test $#* -lt 2 ) { echo 'usage: dcp from{file|dir} ... todir' exit usage } nsrc = `{ echo $#* 1 - p q | dc } sources = $*(1-$nsrc) # would you believe that line preserves spaces in # arguments? rc ist gut! dest = $*($#*) tar -c $sources | @{builtin cd $dest && tar -xT}