This shows you the differences between two versions of the page.
bash:how_to:start [2018/08/02 19:05] Rob Stroess |
— (current) | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== bash: How To ==== | ||
- | * removes within strings | ||
- | * remove first character __x__ in string | ||
- | * VAL=${VAL/__x__/} | ||
- | * remove last character __x__ in string | ||
- | * VAL=${VAL/__x__/} | ||
- | * remove first __n__ characters | ||
- | * VAL=${VAL:__n__} | ||
- | * remove last __n__ characters | ||
- | * VAL=${VAL::-__n__} | ||
- | * extract characters from string | ||
- | * extract characters from position __n__ to __m__ | ||
- | * VAL=${VAL:__n__:__m__} | ||