[ruby-core:32748] Re: ruby requires shebang for executable files?

From: "NARUSE, Yui" <naruse@...>
Date: 2010-10-12 00:58:58 UTC
List: ruby-core #32748
2010/10/12 Roger Pack <rogerdpack2@gmail.com>:
> Hi all. 've noted that ruby typically tries to follow "bash like"
> semantics for executing files, like
> system("ls && ls") works like bash does.

It is /bin/sh, see process.c:1123.
It must be some bourne shell clone; like
* ash (Almquist Shell, used on *BSD)
* dash (Debian Almquist Shell, used on Debian/Ubuntu)
* bash (Bourne-Again Shell, used on many Linux distro and Mac OS X)
http://www.opengroup.org/onlinepubs/9699919799/utilities/sh.html

> However, I've also noticed that if I set a file to executable but do
> not have a shebang, it does nothing--is this expected?

Yes.

-- 
NARUSE, Yui
naruse@airemix.jp

In This Thread