Last active
September 18, 2018 05:30
-
-
Save JonathanWThom/e7db87cd962ba6cb454d4163ff988152 to your computer and use it in GitHub Desktop.
Read current file, write current file's contents to current file, and execute again. Gets out of hand quickly.
This file contains 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
# You'll probably want to Ctrl+C out of this one pretty quickly. | |
File.open($0, "r+") do |f| | |
content = f.read | |
puts content | |
f << content | |
f.close | |
sleep 5 | |
system "ruby", $0 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment