R
Robert Jones
Can you use irb in place of shells like bash or rc?
Some day, some day, somebody smarter and more ambitious than me willnot 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 Bowkett
Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com
John said: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...
build that Ruby-native shell with all the joy of Ruby and command
line tools integrated...
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 Bowkett
Podcast:http://hollywoodgrit.blogspot.com
Blog:http://gilesbowkett.blogspot.com
Portfolio:http://www.gilesgoatboy.org
Tumblelog:http://giles.tumblr.com
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 Bowkett
Podcast:http://hollywoodgrit.blogspot.com
Blog:http://gilesbowkett.blogspot.com
Portfolio:http://www.gilesgoatboy.org
Tumblelog:http://giles.tumblr.com
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 Keeney
I figured you would already know that, which is why I was confused.
Sorry about that. I've no idea about bash completion either.
That's extremely nifty. I also like the name: rush. I recommend using
the 2112 cover art for maxiumum effect.
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 Keeney
Thomas said:Hello --
Some of us are working on the rubyunix project:
http://rubyunix.rubyforge.org/
-- Thomas Adam
not rush.
I definitely and vigorously vote against rash and in favor of rush.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.