Preface
Wanwusangzhi Wanwusangzhi.
A Dragon Boat Festival holiday, so I was really casual to the extreme, na, many times I really think that there are too many temptations is not a person in everyday life, so it filled with clutter in my head, finally cause they can not think very well.
When a child can not resist the temptation, others will blame him, let him wrong all comes down to himself, such as his willpower is not strong enough ah, and so on. But you know, all games or electricity supplier companies are making every effort to analyze the human psychology, if have done this level, and you are not on the set, it means someone else the money wasted = =
Content
11.2.8 delete the contents of variables, substitution and replacement
Gradually understand a little bit for the command, in fact, for many of the string processing, and generally to deal with the order form. So for the set and define commands necessary to avoid ambiguity.
Variable arrangement | Explanation |
---|---|
$ {Keyword} variable # | If the data variable content from scratch in line with "keyword", the shortest data are consistent with the deletion |
$ {Keyword} variable # | If the data variable content from scratch in line with "keyword", the longest matching data deletion |
$ {Variable} keyword% | If the variable content matching "keyword" forward data from the end, it will meet the minimum data deletion |
$ {Keyword} variable %% | If the variable content matching "keyword" forward data from the tail, then the longest line with the deletion of data |
$ {Variable / old keyword / New Keyword} | If the variable content in line with "the old keyword" the first old string will be replaced with a new string |
$ {Variable // old keyword / New Keyword} | If the variable content in line with "the old keyword" all the old string will be replaced with a new string |
For setting and output variables
Variable arrangement | str is not set | str is an empty string | It has been set to the empty string str |
---|---|---|---|
var = $ {str-expr} | was expr = | var = $ str | var = $ str |
var = $ {str -expr} | was expr = | was expr = | var = $ str |
var = $ {str + expr} | was = | was expr = | was expr = |
var = $ {str + expr} | was = | was = | was expr = |
var = $ {str = expr} | p = expr, var = expr | str unchanged, var = $ str | str unchanged, var = $ str |
var = $ {str = expr} | p = expr, var = expr | p = expr, var = expr | str unchanged, var = $ str |
var = $ {str? expr} | expr output to stderr | var = $ str | var = $ str |
var = $ {str? expr} | expr output to stderr | expr output to stderr | var = $ str |
In fact, although today lazy, but at least the contents of the previous 11.4 have read.
The table in front of it might seem clear, but still want to take the time to look for the law. "Bird Brother Linux private kitchens" This book feels complicate the situation here, and here I do feel sort out more clearly.
- ":" Symbol str not provided and str have been set to the empty string case did not affect
- All symbols are set according to the lower left and upper right half divided, so this is also very easy to understand
Daily Task
Eventually, you'll get old, and I will be crowned king.