------ art_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 <david / vallner.net> wrote: > > Michael Guterl wrote: > > Try __FILE__ > > > > On 9/30/06, Une bñ×ue <pere.noel / laponie.com.invalid> 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ñ×ue > >> > > In the executed script, __FILE__ will contain the same as $0. Cf the "if > $0 == __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 ------ art_10088_10356937.1159640897809--