mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-11-22 21:52:31 +03:00
Merge pull request #3249 from heyitswither/fix-substring2
[bash/en] clarify range of substring
This commit is contained in:
commit
6cfd618df3
@ -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"}
|
||||
|
Loading…
Reference in New Issue
Block a user