how can I set my shell to irb?

L

Lex Williams

Hi guys !

I'm running opensuse 11.0 . I would like to know 2 things :

1) is it possible to change my shell from bash to irb ? if so,how ? ( I
tried chsh , but with no success )
2) is it possible to add methods to irb , by writing code in .irbrc ? If
so , could I see an example ?

Thanks
 
N

Nathan Powell

1)
echo 'exec irb' >> ~/.bashrc

2)
npowell@delilah ~ $ grep -A 3 def .irbrc
def test
puts "Oh Hai!"
end
npowell@delilah ~ $ irbOh Hai!



Hi guys !

I'm running opensuse 11.0 . I would like to know 2 things :

1) is it possible to change my shell from bash to irb ? if so,how ? ( I
tried chsh , but with no success )
2) is it possible to add methods to irb , by writing code in .irbrc ? If
so , could I see an example ?

Thanks

--
nathan
nathan_at_nathanpowell_dot_org

The power of accurate observation is commonly called cynicism by those
who have not got it.
~ George Bernard Shaw
------------------------------------
 
A

Anton Ivanov

Lex said:
Hi guys !

I'm running opensuse 11.0 . I would like to know 2 things :

1) is it possible to change my shell from bash to irb ? if so,how ? ( I
tried chsh , but with no success )
2) is it possible to add methods to irb , by writing code in .irbrc ? If
so , could I see an example ?

Thanks

1) Try putting 'exec /usr/bin/irb' or equivalent into your current
shell's rc file. Is typing 'irb' really that painful? :) Do you really
countenance using irb as your main shell???
2) Here's mine:
# load libraries
require 'rubygems'
require 'wirble'

# start wirble (with color)
Wirble.init
Wirble.colorize
Wirble::Colorize.colors[:symbol_prefix] = :green
Wirble::Colorize.colors[:symbol] = :black
 
P

Phil Cowans

Lex said:
Hi guys !

I'm running opensuse 11.0 . I would like to know 2 things :

1) is it possible to change my shell from bash to irb ? if so,how ? ( I
tried chsh , but with no success )
You'll need to add it to /etc/shells, otherwise chsh will not let you
change to it.

Phil
 

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,773
Messages
2,569,594
Members
45,114
Latest member
GlucoPremiumReview
Top