irb and unix shells

G

Giles Bowkett

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 Bowkett

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

John Joyce

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 Bowkett

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...
 
R

Robert Jones

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...

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.
 
M

Marc Heiler

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...;)

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.
 
G

Giles Bowkett

"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 Bowkett

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

MonkeeSage

Is there a way to integrate that with irb?

Tab completion? Already in there. In .irbrc...

require 'irb/completion'
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

Regards,
Jordan
 
G

Gowrisankar Narayanan-IC

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.=20

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.
 
D

Daniel Brumbaugh Keeney

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
 
G

Giles Bowkett

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


--
Giles Bowkett

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

Christopher Anderson

excellent! can't wait for it.

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
 
T

thefed

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
 

Ask a Question

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.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top