From: Eric Wong Date: 2011-08-21T03:09:46+09:00 Subject: Re: Accidentally killing coreutils - an idea to use ruby? Marc Heiler wrote: > Ruby still worked nicely and the tasks such as "mv", "cp" etc.. work in > pure ruby too. You can try un.rb in the standard library: ruby -run -e help I've known about it for years but never used it directly. > Now here is my fairly odd question - when I run something like > "./configure" and it is checking for something like "cp", and if it can > not find it, it will state "cp: command not found", or something, is > there a way to somehow use ruby instead of that? ruby -run -e cp -- [OPTION] SOURCE DEST > 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? You could setup a new bin directory (e.g. /opt/ruby-un/bin/) full of files executable files like: ---------- /opt/ruby-un/bin/cp ---------------- #!/path/to/ruby -run # ARGV will be handled by cp directly, # no need to care for it in this script cp -------------------------- 8< ----------------- ...And have /opt/ruby-un/bin in your $PATH -- Eric Wong