Created
August 14, 2013 22:41
-
-
Save NewAlexandria/6236408 to your computer and use it in GitHub Desktop.
A file that reads from and writes to itself
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
#!/usr/bin/ruby | |
lines = IO.readlines($0) << (DATA.readlines << ARGV[0]) | |
File.open($0, 'w') { |file| file.puts lines } | |
__END__ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment