Skip to content

Commit 89b64e7

Browse files
authored
formatting and grammar fixes (#730)
1 parent f2ad61c commit 89b64e7

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

concepts/more-arrays/about.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,25 @@ We can do the same thing with arrays to expand a slice of the array.
9292
myarray=(one two three four)
9393

9494
subarray=("${myarray[@]:0:2}")
95-
declare -p subarray # => subarray=([0]="one" [1]="two")
95+
declare -p subarray
96+
# => declare -a subarray=([0]="one" [1]="two")
9697

9798
subarray=("${myarray[@]:1:3}")
98-
declare -p subarray # => subarray=([0]="two" [1]="three" [2]="four")
99+
declare -p subarray
100+
# => declare -a subarray=([0]="two" [1]="three" [2]="four")
99101
```
100102

101103
Omitting the length part means "from the offset to the end of the array":
102104

103105
```bash
104106
subarray=("${myarray[@]:2}")
105-
declare -p subarray # => subarray=([0]="three" [1]="four")
107+
declare -p subarray
108+
# => declare -a subarray=([0]="three" [1]="four")
106109
```
107110

108111
## Passing an Array to a Function
109112

110-
This is not as straightforward as other languages you might be know.
113+
This is not as straightforward as other languages you might know.
111114
There are two main techniques to pass an array to a function.
112115

113116
### Pass the Elements

concepts/more-arrays/introduction.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,25 @@ We can do the same thing with arrays to expand a slice of the array.
9292
myarray=(one two three four)
9393

9494
subarray=("${myarray[@]:0:2}")
95-
declare -p subarray # => subarray=([0]="one" [1]="two")
95+
declare -p subarray
96+
# => declare -a subarray=([0]="one" [1]="two")
9697

9798
subarray=("${myarray[@]:1:3}")
98-
declare -p subarray # => subarray=([0]="two" [1]="three" [2]="four")
99+
declare -p subarray
100+
# => declare -a subarray=([0]="two" [1]="three" [2]="four")
99101
```
100102

101103
Omitting the length part means "from the offset to the end of the array":
102104

103105
```bash
104106
subarray=("${myarray[@]:2}")
105-
declare -p subarray # => subarray=([0]="three" [1]="four")
107+
declare -p subarray
108+
# => declare -a subarray=([0]="three" [1]="four")
106109
```
107110

108111
## Passing an Array to a Function
109112

110-
This is not as straightforward as other languages you might be know.
113+
This is not as straightforward as other languages you might know.
111114
There are two main techniques to pass an array to a function.
112115

113116
### Pass the Elements

0 commit comments

Comments
 (0)