From: Martin Weber Date: 2001-12-05T01:16:04+09:00 Subject: [ruby-talk:27456] Re: Programname in (un*x) top On Wed, Dec 05, 2001 at 01:03:17AM +0900, SKa wrote: > Currently I'm using the !#/usr/bin/env ruby approach because I > installed ruby locally as a user (not root) and thought that would be > the 'cleaner' way. It is. > Since ruby has not (yet) achieved the > super-standard-status perl already has (and that enables perl coders > to happily use #!/usr/bin/perl -w) I'd like to ask you what shebang > you use (as most of you probably are far more experienced ruby coders > than me) Using a hardcoded path means you're either arrogant, dumb or explicitely doing something non-portable (i.e. you don'T ever want to run this program on any other machine than yours.) On NetBSD's e.g. you won't find a /usr/bin/perl or /usr/local/bin/perl nor /bin/perl but a /usr/pkg/bin/perl. If perl coders happily use #! /usr/bin/perl -w they're simply <...censored...> ;) > Kind of reminds me of a thread at the perlmonks.org where I asked for > a portable shebang (at http://perlmonks.org/index.pl?node_id=118460 ) it's a pity that the tcl-way doesn't seem to work with ruby; okay env is a program which should be on every unix due to SuSv2 but consider this: --------- #! /bin/sh # in tcl the next line is a comment, too cause of this -> \ exec tclsh "$0" "$@" ...(tcl stuff)... --------- Comments do not mean that a '\' will be ignored, in the above case the shell sees exec tclsh ... but the tclsh will parse that line as comment, too. Martin Weber