From: Simon Krahnke Date: 2008-04-24T21:35:03+09:00 Subject: Re: Executing systems commands * John Maclean (12:19) schrieb: > #why does this work? > k.each do |x| > p system("which #{x}") > end > > # and this work > k.each do |x| > p system("whereis #{x}") > end which and whereis are real programs > # but this doesn't > k.each do |x| > p system("type -p #{x}") > end whereas type is a shell builtin. On my system the standard shell is dash, which doesn't recognize the -p switch. NB: system just returns true or false, the output of the command is not passed to ruby. Use %x for that. mfg, simon .... l