From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <5d6d2e6816f4cad3c83e828f8683e9ab@collyer.net> To: 9fans@cse.psu.edu Subject: Re: [9fans] text utility From: Geoff Collyer In-Reply-To: <8094c5486230a87031c84cbcb873866c@vitanuova.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Tue, 22 Jul 2003 16:28:05 -0700 Topicbox-Message-UUID: 012b41e0-eacc-11e9-9e20-41e7f4b1d025 I'm pretty sure it was Doug McIlroy who used rev rhymdict to produce a rhyming dictionary. To find rhyming words, you'd reverse the suffix of a word, look that up and reverse the result: look `{echo suffix | rev} rhymdict | rev This is described in a memo called `Webster's 2nd on the head of a pin' and dates from the mid-1970s. (I have a copy somewhere.) As for tac, tail -1000000000r does the job for most files of interest (those under a billion lines). I just tried it on a file of ~250,000 lines; it's quite quick. Alternatively, awk '{print NR, $0}' | sort -nr | sed 's/^[0-9]+ //' does the job more slowly.