mirror of
https://github.com/sahinakkaya/til.git
synced 2024-11-14 13:09:37 +01:00
9 lines
124 B
Markdown
9 lines
124 B
Markdown
|
You can split a string with `cut`:
|
||
|
|
||
|
```
|
||
|
foo="hello-world-bye-world"
|
||
|
bar=$(echo $foo | cut -d"-" -f2)
|
||
|
echo $bar
|
||
|
# world
|
||
|
```
|