command #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby -wKU Birds = { 'Mallard' => 'BA', 'Redshank' => 'MA', 'Ringed Plover' => 'RK', 'Turnstone' => 'RP', } regexp = Regexp.new('\b(' + Birds.keys.join('|') + ')\b') STDOUT << STDIN.read.gsub(regexp) { |m| Birds[m] } keyEquivalent name Convert Birdnames outputCaret interpolateByLine uuid D3F9AE87-7043-4B2C-9A1A-51968AC5E8B8