Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/ruby
- if ARGV[0]
- myfile = ARGV[0]
- else
- puts "No filename given"
- exit 1
- end
- system("mv \"#{myfile}\" \"#{myfile}.bak\"")
- File.open("#{myfile}", "w") do |outfile|
- IO.foreach("#{myfile}.bak") do |line|
- if line =~ /size = \d+/
- outfile.print line.sub(/(\d+)/) {|match| match.to_i/10}
- else
- outfile.print line
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement