Article on oreilly.net on how to build Unix tools with Ruby

In article 20030923200517.A36392@freeze.org,

  1. I wish he’d mentioned the option of using #!/usr/bin/env ruby
    instead of #!/usr/local/bin/ruby.

Can someone please explain to me what /usr/bin/env/ruby does?

Speaking of env, does this work on linux when options are passed
to ruby?

I’m not at a linux terminal right now, but when the shebang is:

/usr/bin/env ruby -w

I get the error that ruby -w is not found.
The gnu manual says that it should work, but it certainly
doesn’t work as it does on FreeBSD or Sun.

One way of getting arounf env’s ignoring ARGS iff you are just doing -w
is to put

$VERBOSE = true

after the shebang line. See
http://mail.gnu.org/archive/html/bug-sh-utils/2002-04/msg00020.html
for an explanation.

Hope this helps,

Mike

···

Jim Freeze jim@freeze.org wrote:

On Wednesday, 24 September 2003 at 8:24:36 +0900, Michael W Thelen wrote:

On Wednesday, September 24, 2003, 2:33:01 AM, Paul wrote:


mike@stok.co.uk | The “`Stok’ disclaimers” apply.
http://www.stok.co.uk/~mike/ | GPG PGP Key 1024D/059913DA
mike@exegenix.com | Fingerprint 0570 71CD 6790 7C28 3D60
http://www.exegenix.com/ | 75D2 9EC4 C1C0 0599 13DA

Hal Fulton wrote: (re: runix)
.

Finally I decided: It’s an interesting and fun activity, but it’s not
a high priority for me. I myself am rapidly moving away from Windows,
and it’s not usually wise to invest in the past.

Then think of it as an investment in the future. Just as you leave one
OS for another today, you may do the same in the future, even if going
from one flavor of *nix to another. I’ve run into assorted iratation
because different 'nix do not implement all utilities quite the same
way. Whether it be grep with slighly different switches, or some
version of ifconfig, or whatever, it’s nice to have a known set of tools
that Do The Right Thing wherever they are.

The GNU utilities?

[…]

Gavin

···

On Thursday, September 25, 2003, 4:57:35 AM, James wrote:

Gavin Sinclair wrote:

The aim at the time was to implement a free set of Unix-like tools
for Windows (without the heavyweight solution of Cygwin).

There are other (lightweight) solutions anyway: mingw and unixtools.
I see no point in a Ruby project for this; it doesn’t solve any
problems that I’ve seen come up on the list.

Of course the main reason for Perl Power Tools, Runix, rpt, etc. would
be only-for-fun hacking (or, in Perl lingo, “hubris”). After all, when
Ruby is available in a platform, wouldn’t a C compiler be too?

Also, most of the Unix tools are already established and the
fast-to-prototype-and-change nature of Ruby wouldn’t help much here.

···


dave

Yes, that is our current work around. It’s probably the better
convention because it is reliable for all platforms.

···

On Wednesday, 24 September 2003 at 20:18:42 +0900, Mike Stok wrote:

In article 20030923200517.A36392@freeze.org,

I get the error that ruby -w is not found.
The gnu manual says that it should work, but it certainly
doesn’t work as it does on FreeBSD or Sun.

One way of getting arounf env’s ignoring ARGS iff you are just doing -w
is to put

$VERBOSE = true

after the shebang line. See


Jim Freeze

All things are possible, except skiing thru a revolving door.