1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-01-17 21:49:22 +01:00

[bash/en] clarify range of substring

This commit is contained in:
Tucker Boniface 2018-10-02 19:22:56 -07:00
parent 67f785f102
commit 9152fe00e5
No known key found for this signature in database
GPG Key ID: A37032D665155C61

View File

@ -75,7 +75,7 @@ echo ${Variable/Some/A} # => A string
# Substring from a variable
Length=7
echo ${Variable:0:$Length} # => Some st
# This will return only the first 7 characters of the value
# This will return 7 characters of the string, starting from the first char
# Default value for variable
echo ${Foo:-"DefaultValueIfFooIsMissingOrEmpty"}