Created
May 1, 2017 16:00
-
-
Save ConorOBrien-Foxx/033e6d3e0c3755aea04fc02d18ecb15c to your computer and use it in GitHub Desktop.
Exit code string output
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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