ref: 6213abf8bc893f3d18fa701c248c6316bd473cc6
dir: /bin/syncab/
#!/bin/rc rfork n nomtime=0 if(~ $1 -m){ nomtime=1 shift } if(! ~ $#* 2){ echo usage: $0 [-m] left right exit usage } ref=$1 old=$2 derp -t $ref $ref $old |\ awk \ -F' ' \ -v 'ref='^$ref \ -v 'old='^$old \ -v 'nomtime='^$nomtime \ ' BEGIN{ rm["na"] = rm["dn"] = rm["dm!"] = 1 if(nomtime) nocp["nm"] = 1 } { gsub("\''", "\''\''", $2) if($1 in rm) ls["rm"] = "''" old "/" $2 "'' " ls["rm"] else if(! ($1 in nocp)) ls["cp"] = ls["cp"] " " "''" $2 "''" cnt[$1]++ } END{ for(i in cnt) print "#" i, cnt[i] if("rm" in ls) print "rm", ls["rm"] if("cp" in ls) print "@{cd", ref, "; tar c", ls["cp"], "} | @{cd", old, "; tar xT}" } '