--Multipart_Wed_Aug__4_00:44:12_1999-1
Content-Type: text/plain; charset=ISO-2022-JP

¤´¤È¤±¤ó¤Ç¤¹

In message "[ruby-list:15855] Re: cannot install ruby-gtk into FreeBSD 2.2.x"
    on 99/08/03, Katsuyuki Komatsu <komatsu / sarion.co.jp> writes:

># ¤Þ¤À¡¢¤³¤³¤Þ¤Ç¤¹¤ëɬÍפ¬¤¢¤ë¤«¤È¤¤¤¦·ï¤Ë·ëÏÀ¤ÏƤ¤¤Þ¤»¤ó¤¬¡Ä¡¨Â

¤¨¡¼¤Ã¤È¤¨¡¼¤Ã¤È¤ï¤¿¤Ê¤Ù¤µ¤ó¤â¤¤¤¦¤è¤¦¤Ëº£¤ÎÌäÂê¤ÏÊ̤ˤ·¤Æ¤â 
$^X ¤¬Íߤ·¤¤¤È¤¤¤¦¤Î¤Ï¤¢¤Ã¤¿¤ê¤·¤Þ¤¹¤è¤Í ^^;

# ¤·¤«¤·¤Þ¤Ä¤â¤È¤µ¤ó¤Ïº£Æü¤Ï¤¤¤Ê¤¤¤ó¤À¤Ã¤±¡£¼ÂÁõŪ¤ËÌäÂê¤Ê¤±
# ¤ì¤Ð [ruby-list:15843] ¤ÏºÎÍѤ·¤ÆÍߤ·¤¤¤Î¤À¤±¤É¡£¤â¤¦ÌµÍý??

>    RUBY  {CONFIG["ruby_install_name"]}
>¤ò
>    ruby_interpreter  ile.expand_path(`which #{RUBY_INTERPRETER}`)
>        ¡Ä¡Ä
>    RUBY  {ruby_interpreter}
>¤Ë¤¹¤ì¤Ð¤¤¤¤¤ï¤±¤Ç¤¹¤¬¡¢which¤ò¸Æ¤Ö¤Î¤Ï¤è¤í¤·¤¯¤Ê¤¤¤Î¤Ç¡¢
>ÁêÅö¤¹¤ë¥ë¡¼¥Á¥ó¤¬¤¢¤ì¤Ð¤è¤¤¤«¤È¡£
>
>¤¢¤ê¤Þ¤·¤¿¤Ã¤±¡©

¤Ïµ¤¤Ë¤Ê¤Ã¤Æ¤Ï¤¤¤Þ¤·¤¿¤¬¡¢UNIX¥â¥Ç¥ë¤Ç¤Ï¼Â¹Ô¥Õ¥¡¥¤¥ë¤¬¼«
¿È¤Î¾ìòÃΤëÊýË¡¤Ã¤Æ¤Ê¤¤¤È»×¤¦¤Ç¤¹¡¢¤¿¤Ö¤ó¡£¤Ã¤Æ¤ï¤±¤¨Â
¤Æ¤ß¤Þ¤·¤¿¡£File::which("ls") ["/bin/ls"] ¤È¤¤¤¦¤â¤Î¤Ç¤¹¡£

# FreeBSD ¤Î /usr/bin/which ¤¬ perl ¤À¤Ã¤¿¤Î¤¬²ù¤·¤¯¤Æ ^^;;

¾å¤Î¾ì¹ç¤À¤È¡¢
ruby_interpreter  ile.expand_path(File.which(RUBY_INTERPRETER)[0])

¤â¤Á¤í¤ó¤´»ØÅ¦¤ÎÄ̤ê ./ruby -X dir ¤Ë¤ÏÂбþ¤·¤Þ¤»¤ó¤Î¤Ç¡¢-X
¤Ê¤éÀäÂХѥ¹¤Ç¥¤¥ó¥¿¥×¥ê¥¿¤òµ¯Æ°¤¹¤ë¤«¡¢-X ¤Î¥ê¥¹¥È¤ò¤â¤é¤¦
ɬÍפ¬¤¢¤ê¤Þ¤¹¡£


--Multipart_Wed_Aug__4_00:44:12_1999-1
Content-Type: application/octet-stream
Content-Disposition: attachment; filename="which.rb"
Content-Transfer-Encoding: 7bit

#!/usr/local/bin/ruby

class << File
  def which(target, all  alse)
    path  NV['PATH'].split(':')

    res  ]
    for prog in target
      if (prog '/') && test(?x, prog) && test(?f, prog)
	res.push prog
      else
	for e in path
	  cmd  #{e}/#{prog}"
	  if test(?x, cmd) && test(?f, cmd)
	    res.push cmd
	    break unless all
	  end
	end
      end
    end
    res
  end
end

if __FILE__ $0
  all  ilent  ound  alse
  if ARGV[0] '-a'
    all  rue;    ARGV.shift
  elsif ARGV[0] '-s'
    silent  rue; ARGV.shift
  elsif ARGV[0] /^-((h)|(help)|\\?$)/
    stderr.puts "usage: which [-a] [-s] program ..."
    exit
  end

  res  ile::which(ARGV, all)
  puts res unless silent
  exit (res.empty? ? 1 : 0)
end

--Multipart_Wed_Aug__4_00:44:12_1999-1
Content-Type: text/plain; charset=ISO-2022-JP


>mswin32¤Ç¤Ï¡¢¾ï¤Ë¥Õ¥ë¥Ñ¥¹¤¬¤¯¤ë¤Î¤Ç¡¢
>    RUBY  {RUBY_INTERPRETER}
>¤Ç¤è¤¤¤Ç¤¹¤±¤É¤Í¡£

¤Ï¤ÇÊØÍø¤Ê»ÅÍͤǤ¹¤Í¡£

-- gotoken

--Multipart_Wed_Aug__4_00:44:12_1999-1--