Skip to content

Commit 9363860

Browse files
committed
feat(cheatsheet): ✨ Add a few bits few bits with arrays
1 parent 43c5728 commit 9363860

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

00_cheatsheet/CHEATSHEET.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,18 @@ export MANPAGER=cat
1111
man git
1212
```
1313

14+
## Arrays
15+
16+
Dealing with arrays
17+
18+
```sh
19+
my_array=('hello', 'world')
20+
echo "size:${#my_array[@]}"
21+
22+
my_array+=("again")
23+
echo "size:${#my_array[@]}"
24+
```
25+
1426
## Loops
1527

1628
### For Loops
@@ -46,6 +58,17 @@ done
4658
echo "Exited loop $index"
4759
```
4860

61+
```sh
62+
files=(
63+
'../../output/fx/blending_difference.mp4'
64+
'../../output/fx/blending_mask_difference.mp4'
65+
'../../output/fx/blending_grainmerge.mp4'
66+
)
67+
for file in "${files[@]}"; do
68+
echo "$file"
69+
done
70+
```
71+
4972
### While Loops
5073

5174
A `while` loop

0 commit comments

Comments
 (0)