Merge pull request #3249 from heyitswither/fix-substring2

[bash/en] clarify range of substring
This commit is contained in:
Divay Prakash 2018-10-03 09:54:42 +05:30 committed by GitHub
commit 6cfd618df3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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"}