From: David Vallner Date: 2006-10-01T03:25:07+09:00 Subject: Re: getting the name of the script in use --------------enig2D723A8A4DDFCD867F16FEAF Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Michael Guterl wrote: > Try __FILE__ >=20 > 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 ?) >> --=20 >> une b=E9vue >> In the executed script, __FILE__ will contain the same as $0. Cf the "if $0 =3D=3D __FILE__ main() end" idiom. What's wrong with using basename again? David Vallner --------------enig2D723A8A4DDFCD867F16FEAF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (MingW32) iD8DBQFFHraGy6MhrS8astoRAhYXAJ9VROgiLHQgHNJ4fnx0usr/hoCbhQCdFBCq v/heuBoPyo7kJsZo1Ouxyhg= =NCql -----END PGP SIGNATURE----- --------------enig2D723A8A4DDFCD867F16FEAF--