1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2026-08-16 14:04:47 +02:00

bash: Fix substring expansion with negative offset (#947)

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
This commit is contained in:
hyww
2020-07-05 19:04:28 +08:00
committed by GitHub
parent aff27988e0
commit a54b580e01

View File

@@ -154,7 +154,7 @@ echo ${STR/foo/bar} # /path/to/bar.cpp
```bash
STR="Hello world"
echo ${STR:6:5} # "world"
echo ${STR:-5:5} # "world"
echo ${STR: -5:5} # "world"
```
```bash