From: "Mark J. Reed" Date: 2003-12-18T15:26:55+09:00 Subject: Re: setting $0 On Thu, Dec 18, 2003 at 03:08:39PM +0900, Joel VanderWerf wrote: > #!/usr/bin/env ruby > > $0 = 'My Application' > puts $0 > ---- > > the output is: > > $ ruby -v t.rb > ruby 1.8.1 (2003-12-05) [i686-linux] > My Applicati Looks like a bug. I find it suggestive that the length of the truncated string is 12 characters - the same length as an 8+3 filename including the period. It gets even more interesting, however: the same code works as an -e expression: $ ruby -ve '$0 = "My Application"; puts $0' ruby 1.8.1 (2003-12-05) [i686-linux] My Application (Different quotes for ease of keeping the shell out; I verified that changing the quotes in t.rb to double didn't affect the beahvior) -Mark