7. Global ID (g ID)

Source: Internet
Author: User
Tags uppercase letter

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.