Skip to content

Instantly share code, notes, and snippets.

@ConorOBrien-Foxx
Created May 1, 2017 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ConorOBrien-Foxx/033e6d3e0c3755aea04fc02d18ecb15c to your computer and use it in GitHub Desktop.
Save ConorOBrien-Foxx/033e6d3e0c3755aea04fc02d18ecb15c to your computer and use it in GitHub Desktop.
Exit code string output
a, *c = $*
str = ""
i = `#{a} #{c*?\s}`
loop {
p i
File.write "o.txt", i
i = `#{a} o.txt`
s = $?.exitstatus
p s
break if s == 0
str += s.chr
}
puts "Final result: #{str.inspect}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment