[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Does Ruby simplify our tasks and lives?

Peña, Botp

4/4/2006 8:36:00 AM

Simplicity [mailto:simplicityfirst@gmail.com] wrote last Tuesday, April 04, 2006 3:24 PM:

#I suppose anyone can make something complex or messy, no
#matter what the language or tool. Agree?

yes, but why care/think about that (and worst, aim for it??) ?

programmers solve (people's) problems. it is not easy solving problems. Ergo, the humble programmer must find ways that will make his life happy... On my case, I found ruby, and it has lesser "abstraction impedance", and it has made me happy. Agree?

kind regards -botp


3 Answers

benjohn

4/4/2006 9:01:00 AM

0


I think this may be more of a unix question than a Ruby question...

If I create a test script:
echo "echo hello world" > test_script

On "source" this from the unix command line:
. ./test_script

...and I get the expected result.

I can also run it from the unix command line:
chmod 755 ./test_script
./test_script

...again, I get the expected result.


However, if I now dive in to irb and try to run the script...
irb(main):001:0> `./test_script`

It comes back with:
(irb):1: command not found: ./test_script

However, if I ammend test_script by adding a sh'bang line at the start,
so that it now reads...
#!/bin/sh
echo hello world

And run it from irb, it will "do the right thing". :) I'm just wondering
why?!?!?!

Thankyou for any elucidation,
Benjohn Barnes





Simplicity

4/4/2006 9:34:00 PM

0

I'm not sure people purposely aim for complexity, it is something that
many people, in my experience, just do naturally. Don't know why.
Maybe, it's an attempt to create something better than it needs to be,
but resulting in something more complex than necessary.

I agree. We all want to get home early, enjoy the family, and have a
life. Work smarter, not longer. Choosing the right tools for the job
is a smart thing.

Barry
http://www.simplicit...

kevin

4/4/2006 9:44:00 PM

0

It's because your shell is made to read shell scripts. Ruby needs to
know what to use if it's a different syntax than ruby.