FMeinicke's Wiki

Home

❯

Linux

❯

Shells

❯

zsh

❯

Check if array is empty

Check if array is empty

May 26, 20251 min read

  • zsh/array/length
  • zsh/array/empty

length empty

Source(s)

  • https://gist.github.com/fhuitelec/f900ba41fc6ed55199b2fff4dd226d4d
(( ${#ARRAY[@]} == 0)) && {
    echo array empty
} || {
    echo array not empty
}

Graph View

Created with Quartz v4.5.0 © 2025

  • GitHub