Can someone explain me how those restatements are constructed
suffix=${name#*.}
prefix=${main%%+([0-9])}
num=10#${num}
- What is the logic to use a reg-expr in variable name
- In first string - the '#' seems to mean 'everithing after next mached', but the '.' in reg-exp is a one character, here it seems it used litteraly. Why?
- I guess '%%' means return part that match next expression? Is it correct?
- Why the '()' used in second string? [0-9] - any digit; '+' one or more times; so, +[0-9] should return consecutive numbers from string?! What is the need in '()'
- How to understand third line? What is done by that whith string of digits?
Thank you