#!/usr/bin/ruby -w # Output line and column numbers where "/" characters are found, # with tab expansion. x = y = 1 ARGF.each_char{|c| if c == "/"; print "#{ARGF.path}:#{y}:#{x}:: div\n"; end x += c == "\t" ? 8 - ~-x % 8 : 1 y += c == "\n" ? x = 1 : 0 }