# Ruby and ksh

**URL:** <https://www.ruby-forum.com/t/ruby-and-ksh/68083>\
**Category:** Ruby\
**Created:** [September 9, 2006, 12:37am UTC](https://www.ruby-forum.com/t/ruby-and-ksh/68083 "2006-09-09T00:37:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ClassRubyExceptionH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/bc79bd/32.png) [@ClassRubyExceptionH](https://www.ruby-forum.com/u/ClassRubyExceptionH)\
**Post date:** [September 9, 2006, 12:37am UTC](https://www.ruby-forum.com/t/ruby-and-ksh/68083/1 "2006-09-09T00:37:16Z")

</div>

Hi All… I have just downloaded the ruby-1.8.5-i386-mswin32.zip file  
with the hope that I can use ruby under the Interix 2.2 ksh shell  
implementation. So I created a directory at the C: root C//ksh\_ruby  
and unzipped the install file there. Here is a listing

$ ls -ltr  
total 1775  
-rwx—rwx 1 Compaq\_Owner None 20531 Aug 26 01:16 ruby.exe  
-rwx—rwx 1 Compaq\_Owner None 856124 Aug 26 01:16 msvcrt-ruby18.dll  
-rwx—rwx 1 Compaq\_Owner None 20532 Aug 26 01:16 rubyw.exe  
-rwx—rwx 1 Compaq\_Owner None 1708 Aug 26 01:17 ri.bat  
-rwx—rwx 1 Compaq\_Owner None 1776 Aug 26 01:17 rdoc.bat  
-rwx—rwx 1 Compaq\_Owner None 545 Aug 26 01:17 irb.bat  
-rwx—rwx 1 Compaq\_Owner None 326 Aug 26 01:17 testrb.bat  
-rwx—rwx 1 Compaq\_Owner None 4191 Aug 26 01:17 erb.bat

Being somewhat familiar with Ruby, I thought I could simple run irb.bat  
by ./irb.bat similar to the way it is done under the DOS Shell.  
Howerver, when I tried it I got the following error.

$ ./irb.bat  
./irb.bat: ./irb.bat[1]: @echo: not found  
./irb.bat: ./irb.bat[20]: syntax error: ` **FILE** ’ unexpected

So… since I can’t seem to locate any documentation on this  
implementation, I need some guidance. Is there something I need to add  
to my .profile to make this work. I’m on Interix 2.2 (MS hasn’t  
released an SFU for Windows XP Home yet).

---

<div class="post-metadata">

**Author:** ![ClassRubyExceptionH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/bc79bd/32.png) [@ClassRubyExceptionH](https://www.ruby-forum.com/u/ClassRubyExceptionH)\
**Post date:** [September 9, 2006, 2:27am UTC](https://www.ruby-forum.com/t/ruby-and-ksh/68083/2 "2006-09-09T02:27:27Z")

</div>

ClassRubyExceptionHandline wrote:

> -rwx—rwx 1 Compaq\_Owner None 1708 Aug 26 01:17 ri.bat  
> ./irb.bat: ./irb.bat[1]: @echo: not found  
> ./irb.bat: ./irb.bat[20]: syntax error: ` **FILE** ’ unexpected
> 
> So… since I can’t seem to locate any documentation on this  
> implementation, I need some guidance. Is there something I need to add  
> to my .profile to make this work. I’m on Interix 2.2 (MS hasn’t  
> released an SFU for Windows XP Home yet).

This may help?  
[http://www.microsoft.com/technet/interopmigration/unix/sfu/runwin32.mspx](http://www.microsoft.com/technet/interopmigration/unix/sfu/runwin32.mspx)

Possibly, ksh doesn’t understand the batch language. Mabye you could  
port the batch file to a shell script? Does ruby.exe work in ksh?

Regards,  
Jordan

---

<div class="post-metadata">

**Author:** ![ClassRubyExceptionH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/bc79bd/32.png) [@ClassRubyExceptionH](https://www.ruby-forum.com/u/ClassRubyExceptionH)\
**Post date:** [September 9, 2006, 1:08pm UTC](https://www.ruby-forum.com/t/ruby-and-ksh/68083/3 "2006-09-09T13:08:14Z")

</div>

ClassRubyExceptionHandline wrote:

> Hi All… I have just downloaded the ruby-1.8.5-i386-mswin32.zip file  
> with the hope that I can use ruby under the Interix 2.2 ksh shell  
> implementation.

The shell isn’t too relevant.

> Being somewhat familiar with Ruby, I thought I could simple run irb.bat  
> by ./irb.bat similar to the way it is done under the DOS Shell.  
> Howerver, when I tried it I got the following error.
> 
> $ ./irb.bat  
> ./irb.bat: ./irb.bat[1]: @echo: not found  
> ./irb.bat: ./irb.bat[20]: syntax error: ` **FILE** ’ unexpected

And not apparently familiar with the shells. You need to invoke a batch  
file interpreter to run a batch file. Ksh is a sh-with-extensions  
interpreter. Cmd is a batch file interpreter. $COMSPEC ./irb.bat might  
have worked.

> So… since I can’t seem to locate any documentation on this  
> implementation, I need some guidance. Is there something I need to add  
> to my .profile to make this work. I’m on Interix 2.2 (MS hasn’t  
> released an SFU for Windows XP Home yet).

And never will. SFU is abandoned to the best of my knowledge, and MS is  
adding POSIX support into Windows into the core APIs, not using a  
compatibility layer nowadays.

Also,  
A) [Tool Warehouse](http://www.interix.com/tools/warehouse.htm)

There’s the 1.8.2 ruby for Interix.

On Windows, I’d just use the one-click installer. I have very, very  
severe doubts about the Interix backend making the implementation  
“better” in any way. SFU is just a compatibility layer that tends to  
integrate better with Cygwin (I heard), not an actual POSIX  
implementation. Unless you really, really need Kernel#fork (pretty much  
the only thing I can recall of the native versions not supporting), just  
use the MSVC or Mingw32 builds - those are supported and kept up-to-date  
by the fluffy people at garbagecollect.

David V.

---

<div class="post-metadata">

**Author:** ![ClassRubyExceptionH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/bc79bd/32.png) [@ClassRubyExceptionH](https://www.ruby-forum.com/u/ClassRubyExceptionH)\
**Post date:** [September 9, 2006, 3:38pm UTC](https://www.ruby-forum.com/t/ruby-and-ksh/68083/4 "2006-09-09T15:38:25Z")

</div>

Chris G. wrote:

> On Sep 9, 2006, at 4:06 AM, David V. wrote:
> 
> > fluffy people at garbagecollect
> 
> What are the characteristics of ‘fluffy’ people?

_gibber_

Pleasant, helpful, etc. Picked the term up from A) The Mask cartoon, B)  
Discworld MUD.

David V.

---

<div class="post-metadata">

**Author:** ![ClassRubyExceptionH](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/bc79bd/32.png) [@ClassRubyExceptionH](https://www.ruby-forum.com/u/ClassRubyExceptionH)\
**Post date:** [September 9, 2006, 3:34pm UTC](https://www.ruby-forum.com/t/ruby-and-ksh/68083/5 "2006-09-09T15:34:23Z")

</div>

On Sep 9, 2006, at 4:06 AM, David V. wrote:

> fluffy people at garbagecollect

What are the characteristics of ‘fluffy’ people?
