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