Sed replacement ID g indicates global ). By default, sed will only replace the expression in the opening Syntax of section 6 of the first old in each line ). If you want to replace all the old values in a row with new, you need to use the global ID g.
Replace the first lowercase letter a with the first uppercase letter:
$ Sed's/a/A/'employee.txt
101, John Doe, CEO
102, JAson Smith, ITManager
103, RAjReddy, Sysadmin
104, AnAndRam, Developer
105, JAneMiller, Sales Manager
Replace lowercase letters a with uppercase letters:
$ Sed's/a/A/g'employee.txt
101, John Doe, CEO
102, JAson Smith, ITMAnAger
103, RAjReddy, SysAdmin
104, AnAndRAm, Developer
105, JAneMiller, SAles MAnAger
Note: These two examples apply to the entire file because there is no range specified.
This article is from the "old studio" blog, please be sure to keep this source http://lduan.blog.51cto.com/5428084/1303174