Replacing variables in bash Programming

Source: Internet
Author: User

$ {Var # * word}: it refers to the separator where word is $ var. From left to right, after finding the separator that matches for the first time, remove all characters on the left of the separator (including the separator ).

 

$ {Var ## * word}: The separator with the word as $ var. From left to right, find the last matched separator and remove the separator (including the separator) all characters on the left

 

$ {Var % word *}: The separator with the word as $ var. from the right to the left, after finding the separator for the first match, remove all characters on the right of the separator (including the separator ).

 

$ {Var % word *}: Specifies the separator where word is $ var. from right to left, after finding the last matched separator, remove the separator (including the separator) all characters on the right

 


This article comes from the blog "Let me be more hungry", please be sure to keep this source http://ufirst.blog.51cto.com/7628670/1432612

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.