From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Sat, 29 Jan 2011 17:54:22 -0500 To: 9fans@9fans.net Message-ID: In-Reply-To: <864o8rz5s5.fsf@cmarib.ramside> References: <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: a3fc1a0c-ead6-11e9-9d60-3106f5b1d025 > For some reason, mk decided it would be fun to run the following command > for me: > > 8l $LDFLAGS -o important.h important.h.8 sounds like important.h was the target and a rule like this was chosen: %: %.$O $CC $CFLAGS $stem $stem.$O > Fortunately, there's a magic string in important.h (that exists only in > important.h) that I could use to find the file on /dev/sdC0/fossil. But > Plan 9's grep doesn't seem to support the context switches -A, -B, or > -C. There also doesn't appear to be a hexdup, od, or a pager capable of > performing searches. > > What would be the equivalent to a context grep on Plan 9? Or else, how > might I recover the text surrounding my magic string? strings will give you byte addresses, grep will zero in on your magic string. dd can give you a big block surrounding your magic string. - erik