From 8d4cdca87433ee80627a17bcb08d44a84d3b2e57 Mon Sep 17 00:00:00 2001 From: Ross Smith II Date: Tue, 5 Jan 2021 12:57:23 -0800 Subject: [PATCH] Fix field names to match examples Also spell out `OFFSET` is zero-based. --- manuscript/chapter8.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/manuscript/chapter8.txt b/manuscript/chapter8.txt index 8145fe4..99d8b33 100644 --- a/manuscript/chapter8.txt +++ b/manuscript/chapter8.txt @@ -33,12 +33,12 @@ | Parameter | What does it do? | | --------- | ---------------- | -| `${VAR:OFFSET}` | Remove first `N` chars from variable. -| `${VAR:OFFSET:LENGTH}` | Get substring from `N` character to `N` character.
(`${VAR:10:10}`: Get sub-string from char `10` to char `20`) -| `${VAR:: OFFSET}` | Get first `N` chars from variable. -| `${VAR:: -OFFSET}` | Remove last `N` chars from variable. -| `${VAR: -OFFSET}` | Get last `N` chars from variable. -| `${VAR:OFFSET:-OFFSET}` | Cut first `N` chars and last `N` chars. | `bash 4.2+` | +| `${VAR:OFFSET}` | Remove first `OFFSET` chars from variable. +| `${VAR:OFFSET:LENGTH}` | Get substring from `OFFSET` character to `LENGTH` character. `OFFSET` is zero-based.
(`${VAR:10:10}`: Get sub-string from char `10` to char `20`) +| `${VAR:: OFFSET}` | Get first `OFFSET` chars from variable. +| `${VAR:: -OFFSET}` | Remove last `OFFSET` chars from variable. +| `${VAR: -OFFSET}` | Get last `OFFSET` chars from variable. +| `${VAR:OFFSET:-OFFSET2}` | Cut first `OFFSET` chars and last `OFFSET2` chars. | `bash 4.2+` | ## Case Modification