#!/usr/bin/ruby -w # Output a list of printable non-whitespace ASCII characters that are unused # within an text file. unused = {} (33..126).each{|i| unused[i] = 1} ARGF.each_byte{|c| unused.delete(c) } unused.keys.sort.each{|i| print "#{i}\t#{i.chr.dump[1..-2]}\n" }