sub substitutes the matching pattern in every word in the command line with the substitution. Only the first matched pattern in the word is substituted unless the 'g' flag is given. There are various options that change the way substitutions are performed or the way matches are made. Patterns can have regular expression wildcards (special characters) in them, and the regular expression engine used is Ruby's. Special characters are interpreted as special unless the 'L' flag is given.
Rubygems Documentation Download
gem install cmdline-sub -v 0.1.1