1, variable var from npos∈[0, Length-1] bit start, from left-to-right intercept num characters:
${var:npos:num}
Summary: If NPOs < 0, the result is var original value;
If NPOs > Length (Var)-1 Then the result is an empty string;
If the character does not actually meet the NUM bit, it is returned as the actual character.
2, variable var by the specified string {The first occurrence, the last occurrence}, the forward/backward start interception:
${var##*string} # From left-to-right, the last string begins to intercept
${var#*string} # From left-to-right, the first string begins to intercept
${var%%string*} # from right-to-left, the last string begins to intercept
${var%string*} # from right-to-left, the first string begins to intercept
Summary: For the # Intercept, the wildcard character * is on the left side of string and follows a left-to-right intercept;
For the% intercept, the wildcard character * is to the right of the string and follows the right-to-left intercept;
A single interceptor represents the first occurrence of a position, and a double-intercept indicates the last occurrence.
3, free to summarize other ways ...
Interception of Shell strings