Skip to content

Instantly share code, notes, and snippets.

@mh61503891
Created January 12, 2012 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mh61503891/1602423 to your computer and use it in GitHub Desktop.
Save mh61503891/1602423 to your computer and use it in GitHub Desktop.
TeXソースファイルから全角文字が含まれている行を行番号付きで表示するRubyスクリプト
#!/bin/sh
# Example: $ cat example.txt | this_script
# This script works only for ruby 1.9.x
ruby1.9 -e 'while l=gets;puts "#{$stdin.lineno} #{l}" if l !~ /\A\s*%/&&!l.each_char.select{|c|c.bytesize!=1}.empty?;end'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment