From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <81c92a8342f74040cbdf11041c77e511@quintile.net> From: "Steve Simon" Date: Sat, 29 Jan 2011 22:58:39 +0000 To: 9fans@9fans.net In-Reply-To: <864o8rz5s5.fsf@cmarib.ramside> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] HELP: recoving important header file rudely clobbered by mk Topicbox-Message-UUID: a3e64c72-ead6-11e9-9d60-3106f5b1d025 sorry this happened to you. is this native plan9, p9p, or 9vx? so, are you using fossil or do you run cwfs or kfs or somthing else? do you definitely have fossil and venti running? a missing archive/main looks like you don't have archival dumps enabled in fossil.conf? perhaps you have snapshots enabled? what happens if you run 9fs snap? Here is an implementation of context grep, I think its erik's code but I cannot remember. #!/bin/rc # cgrep - context grep # NB: /dev/null in list of files to force printing source # files when there is just one file supplied grep -n $* /dev/null | sed 's/^(.*):([0-9]*): .*$/\1 \2/' | while(loc=`{read}){ echo $loc(1)^:$loc(2) start=`{echo 'if(' $loc(2) ' > 2) print(' $loc(2) ' - 2) else print 0' | hoc} tail -n +^$start $loc(1) | sed 's/^/ /; 6q' } -Steve