Zsh Shell Tutorial 12: Arrays — Create, Modify & Iterate Collections

9views
00
11:12
T
Taught by Celeste AI - AI Coding Coach
View on YouTube
Description
Learn how to work with arrays in Zsh! In this lesson, we cover basic array creation, 1-based indexing, common operations, associative arrays, and powerful iteration patterns. 📋 Topics Covered: 0:00 - Intro 0:25 - What Are Arrays? 0:59 - Demo: Basic Arrays 2:30 - Array Operations Explained 3:02 - Demo: Append, Slice, Sort & More 4:56 - Associative Arrays Explained 5:30 - Demo: Key-Value Pairs 7:11 - Array Iteration Explained 7:45 - Demo: Loops, Filters & Command Output 9:42 - Recap 10:14 - Outro 🔗 Source Code: https://github.com/GoCelesteAI/zsh_arrays 💡 Key Takeaways: • Zsh arrays are 1-indexed (not 0 like Bash!) • Use += to append and [n]=() to remove elements • declare -A creates associative arrays with key-value pairs • ${(k)array} iterates keys, ${(o)array} sorts values • Build arrays dynamically from command output with $() #zsh #shell #terminal #arrays #scripting #tutorial #programming #linux #macos
Back to tutorials

Duration

11:12

Published

February 14, 2026

Added to Codegiz

March 15, 2026

Open in YouTube