Irb and unix shells

Can you use irb in place of shells like bash or rc?

Can you use irb in place of shells like bash or rc?

not really, but kinda, yeah.

you can do “system (‘any unix command’)” from inside irb really
easily, and you could also set up a method which automatically took
any input you gave irb and passed that along to system, but you
wouldn’t get tab-completion, you’d have to manually print the strings
you received back - they come back with newline escape sequences
rather than newlines - and I really don’t know how you would be able
to get system (or backticks, which do almost exactly the same thing)
to load your .profile or .foo_shrc files.

you can do pretty much anything you want in Unix from within irb, but
actual Unix shells remain the best way to do it. (although I think
there was an actual irb shell written, so I could be wrong.)


Giles B.

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

On Dec 1, 2007, at 6:45 PM, Giles B. wrote:

to get system (or backticks, which do almost exactly the same thing)
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

Some day, some day, somebody smarter and more ambitious than me will
build that Ruby-native shell with all the joy of Ruby and command
line tools integrated…

John J. wrote:

wouldn’t get tab-completion, you’d have to manually print the strings
Giles B.

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

Some day, some day, somebody smarter and more ambitious than me will
build that Ruby-native shell with all the joy of Ruby and command
line tools integrated…

Thanks to both of you and I can only hope that somebody comes along
soon. I
wish I had the experience and skill to do it my self, but multiple
failure
with other big and ambitious projects I took on taught me some humility.

This is one of those questions where consulting with rubyforge.org can
be helpful. :wink:

http://rubyforge.org/projects/rbsh/

I can’t speak for it, I haven’t really used it.

Cameron

“but you wouldn’t get tab-completion”
Well you can, with Readline.readline and using a proc
object for tab completion. The docu is a little bit weird,
but with a little help i got that to work.

Is there a way to integrate that with irb? A Unix shell with .irbrc
special sauce would be pretty nifty. Although I have to admit I
haven’t got the hang of it yet:

! ruby ruby_shell.rb
RubyShell> ls (tab)
.svn/ ruby_shell/ ruby_shell.rb
RubyShell> ls …/README
RubyShell> ls -l !$
RubyShell> ls -l …/README
ls: fts_open: No such file or directory


Giles B.

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

Some day, some day, somebody smarter and more ambitious than me will
build that Ruby-native shell with all the joy of Ruby and command
line tools integrated…

hehe working on that with my limited abilities…:wink:

Unfortunately, aside from time problems, I found two stop things:

First, I need something that can replace irb easily, so that you
get all the important functionality of irb and which has
sufficient docu to allow “normal” programmers unterstand
what is going on (understanding how IRB works is possible,
but i found it takes a lot of time, and isnt as fun as
starting from scratch)
Something that is as flexible as irb-in-a-browser too,
but for some reason I didnt find this very easy…

Second, I still have no real way on how to do piping of
objects/data with a ruby shell. (After all we are talking of a
real shell, no? One like in bash where you can apply filters…)

And also… ruby-ncurses would be nice to have, so that we
can get zsh-like “borders” around a prompt (and RPROMPT etc…
etc… etc…)

But for now its a lot easier to replace all t he simple unix
tools in pure ruby… thats not that difficult, just
quite some work

“but you wouldn’t get tab-completion”
Well you can, with Readline.readline and using a proc
object for tab completion. The docu is a little bit weird,
but with a little help i got that to work.

On Dec 2, 1:29 pm, Giles B. [email protected] wrote:

“but you wouldn’t get tab-completion”
Well you can, with Readline.readline and using a proc
object for tab completion. The docu is a little bit weird,
but with a little help i got that to work.

Is there a way to integrate that with irb?

Tab completion? Already in there. In .irbrc…

require ‘irb/completion’

ls: fts_open: No such file or directory


Giles B.

Podcast:http://hollywoodgrit.blogspot.com
Blog:http://gilesbowkett.blogspot.com
Portfolio:http://www.gilesgoatboy.org
Tumblelog:http://giles.tumblr.com

Regards,
Jordan

Tab completion? Already in there. In .irbrc…

require ‘irb/completion’

I know - got it already. Talking abut Unix tab completion. (That
happens in ruby_shell, but I don’t know how.)


Giles B.

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

Hi,

I have downloaded Rails-1.2.6.zip manually as my proxy settings are
restricting Ruby to do it automatically.

Now that Rails-1.2.6.zip is with me… To which directory should I
extract these files to.

Thanks in advance
Gowrisankar. narayan

DISCLAIMER:
This message contains privileged and confidential information and is
intended only for an individual named. If you are not the intended
recipient, you should not disseminate, distribute, store, print, copy or
deliver this message. Please notify the sender immediately by e-mail if
you have received this e-mail by mistake and delete this e-mail from
your system. E-mail transmission cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete or contain viruses. The sender,
therefore, does not accept liability for any errors or omissions in the
contents of this message which arise as a result of e-mail transmission.
If verification is required, please request a hard-copy version.

On Dec 2, 9:21 pm, Giles B. [email protected] wrote:

Podcast:http://hollywoodgrit.blogspot.com
Blog:http://gilesbowkett.blogspot.com
Portfolio:http://www.gilesgoatboy.org
Tumblelog:http://giles.tumblr.com

I figured you would already know that, which is why I was confused.
Sorry about that. :slight_smile: I’ve no idea about bash completion either.

Regards,
Jordan

That’s extremely nifty. I also like the name: rush. I recommend using
the 2112 cover art for maxiumum effect.

On 12/3/07, Daniel Brumbaugh K. [email protected] wrote:

ideas, but an interactive shell, ability to run UNIX shell scripts,
and other such things are among our goals.

Daniel Brumbaugh K.


Giles B.

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

On Dec 1, 2007 9:55 PM, Robert J. [email protected] wrote:

Some day, some day, somebody smarter and more ambitious than me will
build that Ruby-native shell with all the joy of Ruby and command
line tools integrated…

A group of developers, including the author of rbsh, recently got
together for just such a project.
http://rubyunix.rubyforge.org/

We’re still working out the design and putting together everyone’s
ideas, but an interactive shell, ability to run UNIX shell scripts,
and other such things are among our goals.

Daniel Brumbaugh K.

Hello –

On 03/12/2007, Giles B. [email protected] wrote:

That’s extremely nifty. I also like the name: rush. I recommend using
the 2112 cover art for maxiumum effect.

Some of us are working on the rubyunix project:

http://rubyunix.rubyforge.org/

– Thomas A.

excellent! can’t wait for it.

On Dec 3, 2007 8:50 AM, Daniel Brumbaugh K.

I know - got it already. Talking abut Unix tab completion. (That
happens in ruby_shell, but I don’t know how.)

I figured you would already know that, which is why I was confused.
Sorry about that. :slight_smile: I’ve no idea about bash completion either.

No worries. :slight_smile:


Giles B.

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

I still think if it borrows lots from bash, it should be called rash,
not rush.

Thomas A. wrote:

Hello –

On 03/12/2007, Giles B. [email protected] wrote:

That’s extremely nifty. I also like the name: rush. I recommend using
the 2112 cover art for maxiumum effect.

Some of us are working on the rubyunix project:

http://rubyunix.rubyforge.org/

– Thomas A.

Have you guys also looked at the hotwire project (a new python-shell)
http://code.google.com/p/hotwire-shell/
It has some interesting ideas.

Edwin

On Dec 3, 2007, at 8:00 PM, Giles B. wrote:

I definitely and vigorously vote against rash and in favor of rush.

In honor of how Rails and Rolls are both named after drugs, I think
the shell should be named after some hard drug.

Like maybe ‘Rocks’, which is slang for crack cocaine.

-Ari

I still think if it borrows lots from bash, it should be called rash,
not rush.

no way, dude. that’s like slime, the lisp environment. I don’t care
how awesome it is, I’m not working in slime.

I definitely and vigorously vote against rash and in favor of rush.


Giles B.

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs