J
John Maclean
=begin
Hey chaps.
I'm using an array to find the locations of various commands on a
system. Three versions of the same thing. Two work and one doesn't. Any one
know why?
=end
# here's an array of commands that we want to find
k = %w[ ruby xterm enlightenment emacs]
#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
# but this doesn't
k.each do |x|
p system("type -p #{x}")
end
__END__
Regards,
- jjm
Hey chaps.
I'm using an array to find the locations of various commands on a
system. Three versions of the same thing. Two work and one doesn't. Any one
know why?
=end
# here's an array of commands that we want to find
k = %w[ ruby xterm enlightenment emacs]
#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
# but this doesn't
k.each do |x|
p system("type -p #{x}")
end
__END__
Regards,
- jjm