1

Say you have a bash script test.sh

#!/bin/sh
echo 'Hello World!'


In linux if you wanted to run this in Ruby you would just do

irb(main):001:0> `./test.sh`


In Windows you just get an error

Errno::ENOEXEC: Exec format error - ./test.sh
        from (irb):2:in ``'
        from (irb):2
        from c:/Ruby193/bin/irb:12:in `<main>'


Commands work fine

irb(main):004:0> `grep`
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.

blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/191120

1 Answer 1

3

If you have Bash installed, try:

irb(main):001:0> `bash ./test.sh`
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.