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 22:14:37 -0500 (CDT)

On Fri, 15 Jul 2005, Joe Koski wrote:

Mike Miller wrote:

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


I can't argue with your logic, but there are currently too many scripting languages. On my Mac, I have Applescript, PERL, Python, SED, Tk/Tcl, make, and plain old Unix scripts, which vary depending on the shell. Unless you use a scripting language frequently, the syntax can be a challenge.

Yes, I see that, but the only tricky thing about the perl code above is this regular expression...

(^.*)/[^/]+\.m

...and you can use regexps like that one in a few scripting languages and with egrep and other tools. I definitely highly recommend learning the regexp tricks because you can do some really great things easily once you learn a few things.

Regarding perl - I think it is becoming a core unix tool. We used to use sed and awk for more of the things that perl is now taking over. For programming, there will always be arguments about what is best, but for simple one-liners, I think perl has won that battle, or it has at least won me over.

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]