We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab947f4 commit e53e0a3Copy full SHA for e53e0a3
content/008-bash-arrays.md
@@ -26,10 +26,16 @@ echo ${my_array[1]}
26
echo ${my_array[-1]}
27
```
28
29
-* This would output the total number of elements in the array, in our case it is `4`:
+* As with command line arguments using `@` will return all arguments in the array, as follows: `value 1 value 2 value 3 value 4`
30
31
```bash
32
echo ${my_array[@]}
33
34
35
-Make sure to test this and practice it at your end with different values.
+* Prepending the array with a hash sign (`#`) would output the total number of elements in the array, in our case it is `4`:
36
+
37
+```bash
38
+echo ${#my_array[@]}
39
+```
40
41
+Make sure to test this and practice it at your end with different values.
0 commit comments