Skip to content

Latest commit

 

History

History
13 lines (9 loc) · 244 Bytes

extract-substrings.md

File metadata and controls

13 lines (9 loc) · 244 Bytes

Extract substrings from variables

Extract substrings from BASH variables:

MY_STRING="hello"
SUB_STR=${MY_STRING:0:2}

echo $SUB_STR 
# he

See this post.