From: Robert Klemme Date: 2007-11-08T19:22:41+09:00 Subject: Re: locate oci8.rb 2007/11/8, Rémi Lavergne : > Robert Klemme wrote: > > On 07.11.2007 18:40, R�mi Lavergne wrote: > >> I need to be able to dynamically locate the file oci8.rb from a sh > >> script... > >> Do you have any idea how to do this ? > > > > find / -type f -name oci8.rb > > > > robert > > > Hum... My question was not precise enough. Exactly! :-) > I am looking for the location > of the particular oci8.rb file that my current ruby interpreter is > using. As it has to be done at each execution of my program, I would > like to avoid scanning the entire file system. My ruby interpreter is > able to locate it, I would like to be able to do the same either in ruby > or in sh script. Any idea ? puts $:.find {|dir| File.file? dir + "/oci8.rb"} Cheers robert -- use.inject do |as, often| as.you_can - without end