Tagged as command-line

edit delete favorite
Posted by eric on Nov 05, 2007
Substitute (find and replace) "foo" with "bar" on each line
# 'foo' and 'bar' represent regular expressions
sed 's/foo/bar/'                    # replaces only 1st instance in a line
sed 's/foo/bar/4'                   # replaces only 4th instance in a line
sed 's/foo/bar/g'                   # replaces ALL instances in a line
sed 's/\(.*\)foo\(.*foo\)/\1bar\2/' # replace the next-to-last case
sed 's/\(.*\)foo/\1bar/'            # replace only the last case

# Example: Remove first number in a parenthesied list
sed 's/([0-9]*,/(/g' file.txt > new_file.txt
 
edit delete favorite
Posted by mavenmaven on Nov 08, 2007
You can use the Maven Help Plugin's describe goal. Note that you must give the plugin prefix as the argument to plugin, not it's artifact ID. For example, to find out the version of the install plugin.
mvn help:describe -Dplugin=install
 
Please submit any bugs/features and report abuse. Thanks!
Spacer
Spacer
Spacer
Top Tags
Spacer