Found a neat trick for doing recursive one-liners

“W.B.Hill” [email protected] writes:

Know an OS where that is allowed?

NT 4 kernel mode API is quite happy with \0 in filenames. But it
really confuses the Win32 layer! Haven’t played with later
versions…

So you need to pass the filename size all over? Ugh. :stuck_out_tongue:

Great!

Would any mad enough rubyists start the equivalent of
http://ppt.perl.org/? For the impatient, “perl power tools: unix
reconstruction project” is an on-going attempt at writing (most of) the
BSD command set in Perl.

Not quite as mad as BASIC in TeX, but potentially useful indeed.

–DCA

On Wed, 28 Dec 2005, [email protected] wrote:

That doesn’t seem to do anything . .

then you probably don’t have any files named ‘a.rb’ under the current
directory - i seem to have several hundred :wink:

Or abrb, or acrb, or airbag, or… :slight_smile:

indeed. or diectories. that’s the nice thing about using select:

ruby -e’ puts Dir[“/”].select{|e| test ?f, e and e =~ /^a.rb$/} ’

I was just obliquely pointing out the lack of ^ and . and $ :slight_smile: But
it’s true that Dir.[] is not very seletcive… In fact, I think I
once submitted an RCR to let it take a second argument that would be
tested for (like: Dir[“/”],?f]) but it was rejected. So here I am
several years later still acting as if Dir.[] could read my mind…

David


David A. Black
[email protected]

“Ruby for Rails”, from Manning Publications, coming April 2006!