#!/bin/rc # dircp src dest - copy a tree with tar switch($#*){ case 2 # explicitly mention /fd/* to work with both plan 9 and ape tar @{cd $1 && tar cf /fd/1 .} | @{cd $2 && tar xTf /fd/0} case * echo usage: dircp from to >[1=2] }