From: Robert Klemme Date: 2011-08-20T17:53:45+09:00 Subject: Re: Accidentally killing coreutils - an idea to use ruby? On Fri, Aug 19, 2011 at 8:52 PM, Marc Heiler wrote: > Additionally, would there be a way to completely control all aspects of > > system() > > from within a script, so that I could associate something like "cp" with > a specific action using ruby code instead? I don't think you can realistically. You'd probably have to hack some standard library and I would not even consider opening this can of worms. > Yeah, I have fairly weird ideas sometimes. :-) Don't we all have from time to time? :-) > And no, I have not tested anything yet... but I figure that if ruby is > working somewhere, one could perhaps use pure ruby anyway ... at least > for the basic file operations. You could still use IRB with FileUtils loaded. That looks like a more promising approach. You can't reuse all your shell scripts though. But for that to work a shell script interpreter in Ruby could help. But then again: if you softlink /bin/sh to /usr/local/bin/ruby all your interactive shell functionality is gone (or must be emulated by Ruby). And that topic comes up from time to time but I do not think it's a worthwhile approach to pursue... Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/