Should be: `system "echo '<test/>' | \"#{bin}/xml2\""` with `/xml2` outside of the braces.