Ruby bash replacement

Dear Rubyists, I have been inspired by the wonderful PERL shell known as
Zoidberg (https://metacpan.org/module/Zoidberg) to work on a Ruby UNIX
command shell. I do not think this has already been done yet.

I imagine the ability to use basic commands like cd, ls, echo from Ruby and
also to use controls like >, |, etc. For sysadmins like me, I think this
might be a very useful tool!

So I've started on this task twice without making much progress. My first
approach was to try pass ruby-bits to eval and program execution to popen.
My current thought is that it will be a lot easier to simply override the
class Irb. I'm not sure if this is a bad idea as my code might become tied
to a specific version of ruby/irb.

I'm wondering if anyone else has thought about this problem and cares to
give me any advice/suggestions. If anyone is interested in collaboration,
we could use github.

Thanks!

Rohit

Maybe http://rush.heroku.com/ ?
- --
All the best, Sandor Szücs

···

On 1/22/12 4:27 PM, Rohit Mehta wrote:

Dear Rubyists, I have been inspired by the wonderful PERL shell
known as Zoidberg (https://metacpan.org/module/Zoidberg\) to work on
a Ruby UNIX command shell. I do not think this has already been
done yet.

Alternately, you could base it on one of the third-party IRB
replacements, like pry, ripl, dietrb, etc. (pry already has commands
like `cd`.)

···

On Sun, Jan 22, 2012 at 9:27 AM, Rohit Mehta <pigdog@gmail.com> wrote:

My current thought is that it will be a lot easier to simply override the
class Irb. I'm not sure if this is a bad idea as my code might become tied
to a specific version of ruby/irb.

Alternately, you could base it on one of the third-party IRB
replacements, like pry, ripl, dietrb, etc. (pry already has
commands like `cd`.)

Pry however does not aim to replace bash.

To work on a Ruby UNIX command shell.

I am working on something similar, but it will be a hybrid
shell. It will be somewhat similar to bash in some ways,
and somewhat similar to irb in other ways, although bash-like
syntax will have priority over ruby-like syntax.

I do not think this has already been done yet.

It always depends on how much one thinks it is finished. :slight_smile:

There was an even older version of Rush, by a guy from South Africa.

I remember there were drop-down boxes, in colours, in ruby-ncurses,
when one was typing something like "foo".<TAB WAS PRESSED HERE, THEN THE
DROP DOWN BOX SHOWED UP>

It was quite awesome. :slight_smile:
Sadly the project died.

I imagine the ability to use basic commands like cd, ls, echo from
Ruby and also to use controls like >, |, etc. For sysadmins like
me, I think this might be a very useful tool!

Sure. I myself write ruby scripts rather than shell scripts these
days. The more ruby I can use, the better.

My first approach was to try pass ruby-bits to eval and
program execution to popen.

Eval is too annoying to use IMHO.

Sadly the ruby world has embraced it and extends it further,
with crap like class_eval or module_eval or grandma_eval.

It leads to an overcomplicated design (not always, mind you. I
am using eval myself to use a dynamic configuration object
for my projects, so that a user can extend the configuration
at runtime in any way he or she wants to.)

My current thought is that it will be a lot easier to simply
override the class Irb.

I dont know. I hate IRB. It is underdocumented and ugly.

It can only be recommended for people to instead use pry.
At least that is documented, and it has its own IRC channel
(where you can go, except when you get banned *grin*)

I'm not sure if this is a bad idea as my code might
become tied to a specific version of ruby/irb.

Your code will be tied to the ruby version anyway. And
IRB is just trying to eval that ruby version. But IRB
is really ugly ... if you have luck extending your code
with IRB, I am curious how you did so. :slight_smile:

I'm wondering if anyone else has thought about this problem
and cares to give me any advice/suggestions.

Well, I tried so, and I am still trying to.

This is how my pseudo-shell looks right now:

http://img20.imageshack.us/img20/7564/uploadt.png

Tons of things are still missing though.

If anyone is interested in collaboration,
we could use github.

I am interested in collaboration. My profile is at
https://github.com/shevegen

My pseudo-shell is at https://github.com/shevegen/Diamond-Shell
but beware, I have not updated it for 2 months (but I
change the local code almost daily) - and it still does
not work for anyone else, only for me. I'll fix that one
day, but it is just a hobby, so I can't invest a lot of
time into it - individual components may be re-used by
others though perhaps, hence why collaboration may be
interesting.

Where are you? :slight_smile:

···

--
Posted via http://www.ruby-forum.com/\.

Maybe 'fresh' could help you:

this is some post about it:

http://rbjl.net/43-use-fresh-ruby-as-your-shell

in the fresh's github page, there are also mentioned another
alternatives:



···

--
Posted via http://www.ruby-forum.com/.

I'm the author of Urchin[1]. It aims to be be a Bash-like Unix shell
with great interaction with Ruby. I actually really like interactive
shells like Bash, but think that they start to suck once you need to do
something of a certain complexity. At this point I want a really easy
way to drop some Ruby in there.

Lots of the basic shell stuff works - redirection, globbing, environment
variables and job control - as well as very basic Ruby interaction.
There are a number of cool things that could be added, but I ended up
falling down a Readline rabbit hole (I spent a *lot* of time and effort
fixing bugs in rb-readline and am now wondering if it might be easier
and better to make the GNU Readline binding better).

Unfortunately, various real-life things have taken over of late and it
hasn't seen any work for a few months. I do aim to get back into it
though...

I'd love to hear any more thoughts and ideas you have!

1 - GitHub - Spakman/urchin: A Unix shell for Ruby programmers.

···

On Mon, Jan 23, 2012 at 12:27:19AM +0900, Rohit Mehta wrote:

Dear Rubyists, I have been inspired by the wonderful PERL shell known as
Zoidberg (https://metacpan.org/module/Zoidberg\) to work on a Ruby UNIX
command shell. I do not think this has already been done yet.

I imagine the ability to use basic commands like cd, ls, echo from Ruby and
also to use controls like >, |, etc. For sysadmins like me, I think this
might be a very useful tool!

So I've started on this task twice without making much progress. My first
approach was to try pass ruby-bits to eval and program execution to popen.
My current thought is that it will be a lot easier to simply override the
class Irb. I'm not sure if this is a bad idea as my code might become tied
to a specific version of ruby/irb.

I'm wondering if anyone else has thought about this problem and cares to
give me any advice/suggestions. If anyone is interested in collaboration,
we could use github.

I've never done or even started a shell project but I always figured that
if I did, I would call it rubysh (pronounced rubbish :slight_smile:

(Strictly wordplay; I don't mean to imply that such a utility would in fact
be rubbish.)

David

···

On Sunday, January 22, 2012, Rohit Mehta <pigdog@gmail.com> wrote:

Dear Rubyists, I have been inspired by the wonderful PERL shell known as
Zoidberg (https://metacpan.org/module/Zoidberg\) to work on a Ruby UNIX
command shell. I do not think this has already been done yet.

I imagine the ability to use basic commands like cd, ls, echo from Ruby and
also to use controls like >, |, etc. For sysadmins like me, I think this
might be a very useful tool!

So I've started on this task twice without making much progress. My first
approach was to try pass ruby-bits to eval and program execution to popen.
My current thought is that it will be a lot easier to simply override the
class Irb. I'm not sure if this is a bad idea as my code might become tied
to a specific version of ruby/irb.

I'm wondering if anyone else has thought about this problem and cares to
give me any advice/suggestions. If anyone is interested in collaboration,
we could use github.

Thanks!

Rohit

Thanks Sandor! Rush is really interesting:

local_dir = Rush::Box.new('localhost')['/Users/adam/server_logs/'].create
servers = %w(www1 www2 www3).map { |n| Rush::Box.new(n) } servers.each {

s> s['/var/log/nginx/access.log'].copy_to

local_dir["#{s.host}_access.log"] }

I think it is still too different than a traditional shell for me to use on
a daily basis, but I'm going to enjoy looking at the code!

Rohit

···

On Sun, Jan 22, 2012 at 10:41 AM, Sandor Szücs <sandor.szuecs@fu-berlin.de>wrote:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On 1/22/12 4:27 PM, Rohit Mehta wrote:
> Dear Rubyists, I have been inspired by the wonderful PERL shell
> known as Zoidberg (https://metacpan.org/module/Zoidberg\) to work on
> a Ruby UNIX command shell. I do not think this has already been
> done yet.

Maybe http://rush.heroku.com/ ?
- --
All the best, Sandor Szücs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCgAGBQJPHC4eAAoJEIiuFRwovs5rMGcQAIklhXDAfwWQgipnoG5aCVoi
jXFDxGz4Z/QxiYMVXIeY/1nh8CFXWUN7pLhb4Bihsk3wVLqibRBRUHD9i6musCAf
obZ3pivrEZ2FGurqYPdCv+1/VGKE8BW+42s1mCs6rwpdYqGRqi9/ft3JHNNf7Aws
3RmQimZghIhEmKIAv7A0CqYJKr3q9LCwNrbHIanazheJGgEln+qO5/qTZudY1u6r
4wJ4xNuORXsYLXus2wiX4j11gClAgJYrIJX6T7/44e60sJUW+eM8QP4GT2QPbV8f
zOQpw/RvqqaUxugOauZlzni+mJSGE2OP36FxjSxoSrsbmHXHcKwZ6RyVMHs8WHV+
RldeTEbLkkzcRUHQM3idrNFYMcIh8pRP4JtXf3vVJ0YJfxF3wvTLdTVDzYklX7Rx
hpO0kP/zdiHVwVc0TUKZzMXMch5I6BjS1Y/73d/iLZqDKjEnTeFVWwd5A5Es2KDn
CVn6V7JFCQ3Hx+aeRVuX3mMDKdrgITDYupLKrJ0HbQND9mFNIJ3gdcMjSYN1p8/Y
mGBeWlGYSIkoe3eq0W+erKRok+4XApQkg/JeSrT7hpuh7ENPsVGC5oEuzsvGT5lv
6jyvaa4WxmHen5RRR3ogmg1QITVSFjGhktxx4/FqaROdL68z3r+G5+SgJl5vZ2cH
lknnpOMc2aq6CwHImBes
=fohm
-----END PGP SIGNATURE-----

Marc Heiler wrote in post #1042090:

I do not think this has already been done yet.

It always depends on how much one thinks it is finished. :slight_smile:

There was an even older version of Rush, by a guy from South Africa.

I remember there were drop-down boxes, in colours, in ruby-ncurses,
when one was typing something like "foo".<TAB WAS PRESSED HERE, THEN THE
DROP DOWN BOX SHOWED UP>

It was quite awesome. :slight_smile:
Sadly the project died.

Indeed, this was 2004-2005 or somewhere thereabouts? I've not seen Reyn
anywhere in quite some time. I wasn't personally terribly interested in
the curses interface so I moved on to work on rs, but before I got
around to implementing a solution to the problem of natural object
streams (i.e. pipes for objects as well as text), Rubinius started
taking all my time and it got left by the wayside.

I've not kept tabs on the state of the art terribly well, but I think
the alternatives of Urchin, detailed by Mark earlier, and the new rush,
probably cover most of the regular use cases. There's still – in my
opinion – demand for an object shell, but it's not terribly pressing.

If one did want to work on a shell of their own, the ripl project would
probably be a good place to start. In addition to, that is, carefully
studying the shell-pertinent parts of the *x architecture.

···

--
rue

--
Posted via http://www.ruby-forum.com/\.

Started and abandoned: GitHub - adamwiggins/rush: Ruby replacement for bash+ssh

I've used this in the past but haven't had the time to resurrect and
update it - would be great if someone else picked it up, or leveraged
that work for a replacement.

···

On Tue, Oct 13, 2015 at 2:41 PM, David Black <dblack@rubypal.com> wrote:

I've never done or even started a shell project but I always figured that if
I did, I would call it rubysh (pronounced rubbish :slight_smile:

On Sunday, January 22, 2012, Rohit Mehta <pigdog@gmail.com> wrote:

Dear Rubyists, I have been inspired by the wonderful PERL shell known as
Zoidberg (https://metacpan.org/module/Zoidberg\) to work on a Ruby UNIX
command shell. I do not think this has already been done yet.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

twitter: @hassan
Consulting Availability : Silicon Valley or remote

Hi Rohit,
I assume you read this blog post? Working With... - Jesse Storimer

I have implemented smaller more focused versions of this for work related projects. But I have never attempted to do something fully featured on my own. Good luck. I would be interested it at least seeing how the project goes so if you do get started, feel free to include me in any updates or just send me the github url so I can watch it?

···

On 10/13/2015 17:41:21, David Black wrote:

I've never done or even started a shell project but I always figured that
if I did, I would call it rubysh (pronounced rubbish :slight_smile:

(Strictly wordplay; I don't mean to imply that such a utility would in fact
be rubbish.)

David

On Sunday, January 22, 2012, Rohit Mehta <pigdog@gmail.com> wrote:

Dear Rubyists, I have been inspired by the wonderful PERL shell known as
Zoidberg (https://metacpan.org/module/Zoidberg\) to work on a Ruby UNIX
command shell. I do not think this has already been done yet.

I imagine the ability to use basic commands like cd, ls, echo from Ruby and
also to use controls like >, |, etc. For sysadmins like me, I think this
might be a very useful tool!

So I've started on this task twice without making much progress. My first
approach was to try pass ruby-bits to eval and program execution to popen.
My current thought is that it will be a lot easier to simply override the
class Irb. I'm not sure if this is a bad idea as my code might become tied
to a specific version of ruby/irb.

I'm wondering if anyone else has thought about this problem and cares to
give me any advice/suggestions. If anyone is interested in collaboration,
we could use github.

Thanks!

Rohit

--
Raj Sahae
408.230.8531

It's also worth noting that you can simply set irb as your actual shell (for a *nix system) and run that way. I wouldn't recommend it as using pipes and all that useful stuff is much harder to do, but you get the idea.

···

On 10/13/2015 15:01:52, Hassan Schroeder wrote:

On Tue, Oct 13, 2015 at 2:41 PM, David Black <dblack@rubypal.com> wrote:

I've never done or even started a shell project but I always figured that if
I did, I would call it rubysh (pronounced rubbish :slight_smile:

On Sunday, January 22, 2012, Rohit Mehta <pigdog@gmail.com> wrote:

Dear Rubyists, I have been inspired by the wonderful PERL shell known as
Zoidberg (https://metacpan.org/module/Zoidberg\) to work on a Ruby UNIX
command shell. I do not think this has already been done yet.

Started and abandoned: GitHub - adamwiggins/rush: Ruby replacement for bash+ssh

I've used this in the past but haven't had the time to resurrect and
update it - would be great if someone else picked it up, or leveraged
that work for a replacement.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
Hassan Schroeder | about.me
twitter: @hassan
Consulting Availability : Silicon Valley or remote

--
Raj Sahae
408.230.8531

I would take a look at pry , its the closest thing I can think off

http://www.aqua-mail.com

···

Sent with AquaMail for Android

On October 14, 2015 12:41:42 AM David Black <dblack@rubypal.com> wrote:

I've never done or even started a shell project but I always figured that if I did, I would call it rubysh (pronounced rubbish :slight_smile:

(Strictly wordplay; I don't mean to imply that such a utility would in fact be rubbish.)

David

On Sunday, January 22, 2012, Rohit Mehta <pigdog@gmail.com<mailto:pigdog@gmail.com>> wrote:
Dear Rubyists, I have been inspired by the wonderful PERL shell known as
Zoidberg (https://metacpan.org/module/Zoidberg) to work on a Ruby UNIX
command shell. I do not think this has already been done yet.

I imagine the ability to use basic commands like cd, ls, echo from Ruby and
also to use controls like >, |, etc. For sysadmins like me, I think this
might be a very useful tool!

So I've started on this task twice without making much progress. My first
approach was to try pass ruby-bits to eval and program execution to popen.
My current thought is that it will be a lot easier to simply override the
class Irb. I'm not sure if this is a bad idea as my code might become tied
to a specific version of ruby/irb.

I'm wondering if anyone else has thought about this problem and cares to
give me any advice/suggestions. If anyone is interested in collaboration,
we could use github.

Thanks!

Rohit

The thought of a ruby shell crossed my mind in the past. I was going to call it 'Rush'. This shell would then become part of a ruby based linux called 'RubOS' and finally rid the world of all shell/perl/python scripts :wink:
The complexity and sheer amount of work involved, for a ruby shell, made me faint, so I never pursued it any further (stored under category rubbish ideas).

Ivo

···

From: David Black
Sent: Tuesday, October 13, 2015 11:41 PM
To: ruby-talk@ruby-lang.org
Subject: Re: Ruby bash replacement

I've never done or even started a shell project but I always figured that if I did, I would call it rubysh (pronounced rubbish :slight_smile:

(Strictly wordplay; I don't mean to imply that such a utility would in fact be rubbish.)

David

On Sunday, January 22, 2012, Rohit Mehta <pigdog@gmail.com> wrote:

  Dear Rubyists, I have been inspired by the wonderful PERL shell known as
  Zoidberg (https://metacpan.org/module/Zoidberg) to work on a Ruby UNIX
  command shell. I do not think this has already been done yet.

  I imagine the ability to use basic commands like cd, ls, echo from Ruby and
  also to use controls like >, |, etc. For sysadmins like me, I think this
  might be a very useful tool!

  So I've started on this task twice without making much progress. My first
  approach was to try pass ruby-bits to eval and program execution to popen.
  My current thought is that it will be a lot easier to simply override the
  class Irb. I'm not sure if this is a bad idea as my code might become tied
  to a specific version of ruby/irb.

  I'm wondering if anyone else has thought about this problem and cares to
  give me any advice/suggestions. If anyone is interested in collaboration,
  we could use github.

  Thanks!

  Rohit

I just noticed this project has three pull requests, one of which is
called "Resurrect rush", in which the submitter actually requests
maintainership of the project if you aren't going to maintain it any
longer.

···

On Tue, Oct 13, 2015 at 03:01:52PM -0700, Hassan Schroeder wrote:

Started and abandoned: GitHub - adamwiggins/rush: Ruby replacement for bash+ssh

I've used this in the past but haven't had the time to resurrect and
update it - would be great if someone else picked it up, or leveraged
that work for a replacement.

--
Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]

Look at xiki, xiki.org . Idea is to have a executable notebook. See
screencasts online. You can execute ruby code from it.
The thought of a ruby shell crossed my mind in the past. I was going to
call it 'Rush'. This shell would then become part of a ruby based linux
called 'RubOS' and finally rid the world of all shell/perl/python scripts
:wink:
The complexity and sheer amount of work involved, for a ruby shell, made me
faint, so I never pursued it any further (stored under category rubbish
ideas).

Ivo

···

*From:* David Black <dblack@rubypal.com>
*Sent:* Tuesday, October 13, 2015 11:41 PM
*To:* ruby-talk@ruby-lang.org
*Subject:* Re: Ruby bash replacement

I've never done or even started a shell project but I always figured that
if I did, I would call it rubysh (pronounced rubbish :slight_smile:

(Strictly wordplay; I don't mean to imply that such a utility would in fact
be rubbish.)

David

On Sunday, January 22, 2012, Rohit Mehta <pigdog@gmail.com> wrote:

Dear Rubyists, I have been inspired by the wonderful PERL shell known as
Zoidberg (https://metacpan.org/module/Zoidberg\) to work on a Ruby UNIX
command shell. I do not think this has already been done yet.

I imagine the ability to use basic commands like cd, ls, echo from Ruby and
also to use controls like >, |, etc. For sysadmins like me, I think this
might be a very useful tool!

So I've started on this task twice without making much progress. My first
approach was to try pass ruby-bits to eval and program execution to popen.
My current thought is that it will be a lot easier to simply override the
class Irb. I'm not sure if this is a bad idea as my code might become tied
to a specific version of ruby/irb.

I'm wondering if anyone else has thought about this problem and cares to
give me any advice/suggestions. If anyone is interested in collaboration,
we could use github.

Thanks!

Rohit