Published in: Other
URL: http://snippets.dzone.com/posts/show/4894
http://snippets.dzone.com/posts/show/4894
grep widget mlb | awk '{print $3}' | sed 's/-->/ /g' sed sub --> with blank space g= global # substitute "foo" with "bar" ONLY for lines which contain "baz" sed '/baz/s/foo/bar/g' # substitute "foo" with "bar" EXCEPT for lines which contain "baz" sed '/baz/!s/foo/bar/g' # change "scarlet" or "ruby" or "puce" to "red" sed 's/scarlet/red/g;s/ruby/red/g;s/puce/red/g' # most seds gsed 's/scarlet\|ruby\|puce/red/g' Substitute newlines for & sed -e 's/&/\n/g' test.txt
You need to login to post a comment.
