TIL: Splitting a string with delimiter

This commit is contained in:
Asocia 2021-07-03 17:18:51 +03:00
parent f07121706c
commit c0c710df69

View File

@ -0,0 +1,8 @@
You can split a string with `cut`:
```
foo="hello-world-bye-world"
bar=$(echo $foo | cut -d"-" -f2)
echo $bar
# world
```