From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <9e333833932a9ea6bcc1a0a7594ccd19@rei2.9hal> Date: Wed, 19 Sep 2012 08:47:33 +0200 From: cinap_lenrek@gmx.de To: 9fans@9fans.net In-Reply-To: <20120919063127.4FD08B827@mail.bitblocks.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] union directories exploration Topicbox-Message-UUID: ba2cf700-ead7-11e9-9d60-3106f5b1d025 this has been done before. i can't remember who wrote it and i couldnt find it in the contrib index. #!/bin/rc fn get_dirs { tmp = /tmp/$pid ^_dirs echo -n > $tmp for (f in `{du -nf $root_in | awk '{print $2}' }) ls -l $f | grep '^d' | awk '{print $10}' >> $tmp dirs = `{sort $tmp} rm $tmp } root_in=$1 root_out=$2 if(~ $3 '') get_dirs; if not dirs = `{cat $3}; for(i in $dirs){ o=`{echo $i | awk '{gsub(ENVIRON["root_in"], ENVIRON["root_out"], $0); print}'} echo bind -bc $i $o } theres also divergefs. -- cinap