til/bash-scripting/splitting-a-string-with-delimiter.md
2021-07-03 17:18:51 +03:00

124 B

You can split a string with cut:

foo="hello-world-bye-world"
bar=$(echo $foo | cut -d"-" -f2)
echo $bar
# world