help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: finding .m files using 'locate'


From: Mike Miller
Subject: Re: finding .m files using 'locate'
Date: Fri, 15 Jul 2005 21:12:01 -0500 (CDT)

On Fri, 15 Jul 2005, Joe Koski wrote:

on 7/15/05 3:50 PM, Mike Miller at address@hidden wrote:

locate '*.m' | perl -pe 's#(^.*)/[^/]+\.m#$1#g' | sort | uniq

Back in the '80s, Byte Magazine reported the annual winner of the obfuscated C contest. The object was to write a C program that actually did something, but nobody could decide what it was. Maybe we should have and obfuscated UNIX/perl contest.


Three things:

(1) you don't have to understand it to use it,
(2) it's not that hard to read that perl regexp and
(3) it runs 100 times faster than the "xargs dirname" code.

Mike



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]