Once you've got the return you can do any substitutions required for 
your special name:

cmd = 'fm_shell'
=> "fm_shell"
toolName = cmd[/\A(astro|core|fm_shell|formality|gca_shell|xa)\z/i, 1 ]
=> "fm_shell"
subs = { 'fm' => [ 'fm_shell', 'formality' ], 'gcas' => [ 'gca_shell' ] 
}
=> {"fm"=>["fm_shell", "formality"], "gcas"=>["gca_shell"]}
subs.each { |output, input| toolName = output if input.include? toolName 
}
=> {"fm"=>["fm_shell", "formality"], "gcas"=>["gca_shell"]}
toolName
=> "fm"

-- 
Posted via http://www.ruby-forum.com/.