-
-
Save avescodes/244774 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env ruby | |
filename = ARGV.shift | |
lines = [] | |
File.open(filename, 'r') do |f| # open file for update | |
lines = f.readlines # read into array of lines | |
lines.each do |it| # modify lines | |
it.gsub!(/;.*/, '') | |
end | |
end | |
File.open("stripped-"+filename, 'w') do |f| | |
f.print lines # write out modified lines | |
f.truncate(f.pos) # truncate to new length | |
end # file is automatically closed | |
puts `./assembler stripped-#{filename}` | |
`mv stripped-#{filename.gsub('asm','o')} #{filename.gsub('asm','o')}` | |
`rm stripped-#{filename}` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment