diff options
author | Andrey Samsonov <andrey.samsonov@gmail.com> | 2015-05-02 15:34:56 +0400 |
---|---|---|
committer | Andrey Samsonov <andrey.samsonov@gmail.com> | 2015-05-02 15:34:56 +0400 |
commit | 8758bb845b063b76b55d2c178d0dc393b2a39c5c (patch) | |
tree | d52060f5892992e39cab4f2472acca9b09a6d798 | |
parent | 7f1c4293e448f9ff1e14587c189dd672ad8c19e5 (diff) |
Clear that length and position can be set by variable in substring extraction
-rw-r--r-- | bash.html.markdown | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bash.html.markdown b/bash.html.markdown index e0c12f97..81f85d28 100644 --- a/bash.html.markdown +++ b/bash.html.markdown @@ -59,7 +59,8 @@ echo ${VARIABLE/Some/A} # This will substitute the first occurance of "Some" with "A" # Substring from a variable -echo ${VARIABLE:0:7} +LENGTH=7 +echo ${VARIABLE:0:LENGTH} # This will return only the first 7 characters of the value # Default value for variable |