9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: cinap_lenrek@gmx.de
To: 9fans@9fans.net
Subject: Re: [9fans] union directories exploration
Date: Wed, 19 Sep 2012 08:47:33 +0200	[thread overview]
Message-ID: <9e333833932a9ea6bcc1a0a7594ccd19@rei2.9hal> (raw)
In-Reply-To: <20120919063127.4FD08B827@mail.bitblocks.com>

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



  reply	other threads:[~2012-09-19  6:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-19  6:31 Bakul Shah
2012-09-19  6:47 ` cinap_lenrek [this message]
2012-09-19  7:42   ` Bakul Shah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e333833932a9ea6bcc1a0a7594ccd19@rei2.9hal \
    --to=cinap_lenrek@gmx.de \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).