More typos
This commit is contained in:
parent
876b845840
commit
b235bb2d89
6
bash.md
6
bash.md
|
@ -119,15 +119,15 @@ Parameter expansions
|
|||
name="John"
|
||||
echo ${name}
|
||||
echo ${name/J/j} #=> "john" (substitution)
|
||||
echo ${name:0:2} #=> "jo" (slicing)
|
||||
echo ${name::2} #=> "jo" (slicing)
|
||||
echo ${name:0:2} #=> "Jo" (slicing)
|
||||
echo ${name::2} #=> "Jo" (slicing)
|
||||
echo ${name::-1} #=> "Joh" (slicing)
|
||||
echo ${food:-Cake} #=> $food or "Cake"
|
||||
```
|
||||
|
||||
```bash
|
||||
length=2
|
||||
echo ${name:0:length} #=> "jo"
|
||||
echo ${name:0:length} #=> "Jo"
|
||||
```
|
||||
|
||||
See: [Parameter expansion](http://wiki.bash-hackers.org/syntax/pe)
|
||||
|
|
Loading…
Reference in New Issue