From: Michael Guterl Date: 2006-10-01T03:28:22+09:00 Subject: Re: getting the name of the script in use ------=_Part_10088_10356937.1159640897809 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On 9/30/06, David Vallner wrote: > > Michael Guterl wrote: > > Try __FILE__ > > > > On 9/30/06, Une b=E9vue wrote: > >> > >> > >> I'd like getting the name of the script in use, if i make use of $0 i > >> get the whole path of the script, ie : > >> > >> /path/to/script/the_script.rb > >> > >> no way to get only "the_script.rb" > >> > >> (without using file basename ?) > >> -- > >> une b=E9vue > >> > > In the executed script, __FILE__ will contain the same as $0. Cf the "if > $0 =3D=3D __FILE__ main() end" idiom. Doh. Silly me, I was running it from . so no path was being added... What's wrong with using basename again? > > David Vallner > > > > Michael Guterl ------=_Part_10088_10356937.1159640897809--