irb and unix shells

C

Christopher Anderson

rash: terrible
rush: terrible

mogok! it sounds cool, it's related to rubies, erm, and apparently has
a violent and oppressive history...

hey it would also be humanitarian in how it brings to light an issue
that people might not have thought about?

90% of the world's rubies come from Myanmar. The red stones from there
are prized for their purity and hue. Thailand buys the majority of
Myanmar's gems. The "Valley of Rubies", the mountainous Mogok area,
200 km (125 miles) north of Mandalay, is noted for its rare pigeon's
blood rubies and blue sapphires. Working conditions in the mines,
however, are said to be horrendous. Debbie Stothard of the Alternative
ASEAN Network on Burma stated that mining operators used drugs on
employees to improve productivity, with needles shared, raising the
risk of HIV infection: "These rubies are red with the blood of young
people." Brian Leber (jeweler who founded The Jewellers' Burma Relief
Project) stated that "for the time being," Burmese gems should not be
something to be proud of. (from wikipedia)

http://www.ruby-sapphire.com/pigeons-blood-mogok.htm is friendlier.

/usr/bin/mogok! /usr/bin/mogok!
 
G

Giles Bowkett

Mogok is totally depressing. You must face down evil, but never focus
on it. First rule of whoever that spiritual guy was with the rules
that one time. That's even worse than rash.

Rush sounds exciting and fun, and has decades of drum solos to back up
its reputation. Wow! What a rush!

Besides, I only advocate rush because the project is already named
rush, and was named rush by the people who are programming it. I think
actually the voting process, if there even is one, will heavily bias
the votes of people who contribute code to the project.

rash: terrible
rush: terrible

mogok! it sounds cool, it's related to rubies, erm, and apparently has
a violent and oppressive history...

hey it would also be humanitarian in how it brings to light an issue
that people might not have thought about?

90% of the world's rubies come from Myanmar. The red stones from there
are prized for their purity and hue. Thailand buys the majority of
Myanmar's gems. The "Valley of Rubies", the mountainous Mogok area,
200 km (125 miles) north of Mandalay, is noted for its rare pigeon's
blood rubies and blue sapphires. Working conditions in the mines,
however, are said to be horrendous. Debbie Stothard of the Alternative
ASEAN Network on Burma stated that mining operators used drugs on
employees to improve productivity, with needles shared, raising the
risk of HIV infection: "These rubies are red with the blood of young
people." Brian Leber (jeweler who founded The Jewellers' Burma Relief
Project) stated that "for the time being," Burmese gems should not be
something to be proud of. (from wikipedia)

http://www.ruby-sapphire.com/pigeons-blood-mogok.htm is friendlier.

/usr/bin/mogok! /usr/bin/mogok!


--
Giles Bowkett

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

botp

Rush sounds exciting and fun, and has decades of drum solos to back up
its reputation. Wow! What a rush!

i'd be more excited if the shell can run on windows, too. Unix shells
are already very powerful. One can throw just about any language to
it. A windows shell is wanting, and would be a killer app for windows.
The command shell in windows is terrible; heck, i cannot even do a
ctrl-pgup - grr!@#$

kind regards -botp
 
T

thefed

Mogok is totally depressing. You must face down evil, but never focus
on it. First rule of whoever that spiritual guy was with the rules
that one time. That's even worse than rash.

Rush sounds exciting and fun, and has decades of drum solos to back up
its reputation. Wow! What a rush!

Besides, I only advocate rush because the project is already named
rush, and was named rush by the people who are programming it. I think
actually the voting process, if there even is one, will heavily bias
the votes of people who contribute code to the project.

You are all forgetting about three things:
First, the code. We need code to go along with this!
Second, the rubyunix mailing list. This thread belongs THERE!
Third, Mr Bowket please update your blog with something Rubyish.


Thanks,
Ari
 
T

thefed

i'd be more excited if the shell can run on windows, too. Unix shells
are already very powerful. One can throw just about any language to
it. A windows shell is wanting, and would be a killer app for windows.
The command shell in windows is terrible; heck, i cannot even do a
ctrl-pgup - grr!@#$


You're in luck - since it's Ruby based, this kind of thing would
actually work.

Check out the mailing list

- Ari
 
M

MonkeeSage

i'd be more excited if the shell can run on windows, too. Unix shells
are already very powerful. One can throw just about any language to
it. A windows shell is wanting, and would be a killer app for windows.
The command shell in windows is terrible; heck, i cannot even do a
ctrl-pgup - grr!@#$

kind regards -botp

OT: cygwin comes with sh or bash or some form of posix shell as I
recall, I think I also saw a native version of bash (but this was
several years ago). BTW, did you mean shift-pgup (scroll up) or is my
shell missing something?

Regards,
Jordan
 
M

Marc Heiler

One can throw just about any language to it.

I think that is a bit too short-sighted in the long run.
I don't know how you feel about it, but to me ruby evolves
around 100x faster than i.e. bash. And this includes new
ideas too. ;-)

Most scripts used on a *nix system will be shell scripts, i.e.
bootup scripts for example, and IMHO ruby beats shell scripts
with ease in pretty every regard (if you are able to use ruby
on your system that is).
Making a shell more a ruby-shell, also making it a practical
shell is a big advantage: You no longer have to care about
bash being the first-class citizen on your system, and then
throwing second class languages at it, you simply have your
many .rb files (many classes, many objects on your system)
and connect them together with that ruby-shell environment
being the first class citizen.
I think this is a nicer approach, and it's just a matter
of time until that all comes together in a practical
manner :)
rubyunix.rubyforge.org is a first nice step, let's see.

However, that being said (and since ruby+irb work on windows
as well), I agree with your remark about Windows.

(As a sidenote, the original, ancient rush was in part inspired
about the old monad shell on Windows presentation, which
showcased filtering on a dataset, and finally piping it into
some excel application which depicted a nice little graph. )

The command shell in windows is terrible; heck, i cannot even do a
ctrl-pgup - grr!@#$

Yeah it is ... some tools that can be usable on windows are
Mingw/MSys, Readline for windows, and Rlwrap. And of course ruby's
irb is not that bad either :) in general Windows can be
quite usable once you use loads of open sourced stuff on
it and stand away from the other cr** IMHO ;-)
What did Larry say about perl? Use it's strength, not it's
weakness. I guess for windows the same accounts... avoid
its many pitfalls! ;-)
 
J

James Edward Gray II

Most scripts used on a *nix system will be shell scripts, i.e.
bootup scripts for example, and IMHO ruby beats shell scripts
with ease in pretty every regard (if you are able to use ruby
on your system that is).

They have totally different focuses. I can see saying that Ruby is
superior to bash as a general programming, but I would far prefer
bash if I'm piping a bunch of utilities together, redirecting
streams, and the like.

James Edward Gray II
 
C

Csaba Henk

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

I started to create these tools some years ago, see:

http://creo.hu/~csaba/ruby/pope/

Pope stands for "Powerful Piping Environment", a ruby implementation
of
the simple Unix IPC constructs (mainly pipes), and atop of it Urb,
an Irb hack which can be used as a shell (it has job control)
and features some syntax sugar to make this easy:

- basic Urb listener can do pipes like

_("ls").|("grep '\.rb$'")_

or if you need to be more exact (ie., you don't wanna rely on
shellish command line parsing), you can do it like:

_(["lame", "--decode", "Star Spangled Banner.mp3"]).|("oggenc -
ssb.ogg")._

Irb completion is enhanced to make such lines easy to type.

- there is an other listener called Pidginsh, which can started with
"pidginsh"
(and be left with ^D). It partially groks Bourne shell syntax and
dynamically
translates shell commands to standard Urb calls. So in pidginsh

ls | grep '\.rb$'

will work and is equivalent with the above cited Urb command.

Alas, I didn't have the energy to finish this project and make it
really shine.
Even so, it's usable in its current form, I use it all the time
(however, you
probably won't end up like this, due to the lack of documentation :
(( ).

This code is available via Mercurial from http://mercurial.creo.hu/repos/pope/
or as a direct tarball download: http://mercurial.creo.hu/repos/pope/?archive/tip.tar.gz

Csaba
 
T

thefed

Once again, since people are really getting into this, I ENOURAGE YOU
ALL TO JOIN THE RUBYUNIX MAILING LIST.


Thanks,
Ari
 
G

Giles Bowkett

Once again, since people are really getting into this, I ENOURAGE YOU
ALL TO JOIN THE RUBYUNIX MAILING LIST.

You know, this is an interesting discussion, it's too bad there isn't
a mailing list we could take this to which is totally focused on this
topic and this project. Oh well. I guess I'll make myself a hamburger.

--
Giles Bowkett

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

thefed

You know, this is an interesting discussion, it's too bad there isn't
a mailing list we could take this to which is totally focused on this
topic and this project. Oh well. I guess I'll make myself a hamburger.

I will wait until your blog has comments and I will troll them
forever if you don't join.

http://preeventualist.org/lost

Please.

-ari
 
G

Giles Bowkett

E

Eero Saynatkari

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

Not terribly smart and definitely not ambitious here, but this thread is
a strange happenstance since I just dusted off the rs repository. This
is
probably a good place to take a peek:

http://repos.kittensoft.org/rs/doc/HOWTO.using
http://repos.kittensoft.org

I have not had the time to work on rs in a long, long while but the
codebase looks OK still and the functionality is fairly nice. The
idea was to first gradually implement as powerful as possible shell
in pure Ruby syntax and then possibly later offer a parser on top of
it (so that one could e.g. use /tmp/foo rather than '/tmp/foo'.)

The current syntax was left as unobtrusive by default as possible.
FileSystemObjects, for example, cannot be implicitly created from
Strings (this is left for the user to do, just set up a #method_missing
handler) but overall it is pretty flexible. The above link has
some examples but the one I have often used:

(ls | tr('a-z A-Z')).each {|f| p f.reverse}

Anyway.

Perhaps more news in the near future!
 

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,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top