#!/usr/bin/ruby unless ARGV[0] puts "Usage: #{$0} file" exit end file = ARGV[0] if file =~ /^(.*)\.doc$/ then stripped=$1 else stripped=file end # .doc -> text: antiword command = "antiword -w 0 -m cp1251 #{file} >#{stripped}.tmp" puts "Executing #{command}" puts `#{command}` # text -> dokuwiki: interlace-footnotes.rb command = "ruby interlace-footnotes.rb #{stripped}.tmp >#{stripped}.wiki" puts "Executing #{command}" puts `#{command}`