dircp 200 B

123456789
  1. #!/bin/rc
  2. # dircp src dest - copy a tree with tar
  3. switch($#*){
  4. case 2
  5. @ {builtin cd $1 && tar cif /fd/1 .} | @ {builtin cd $2 && tar xTf /fd/0}
  6. case *
  7. echo usage: dircp from to >[1=2]
  8. exit usage
  9. }