array operations (multiple commands)

PHOTO EMBED

Thu Jun 01 2023 13:19:41 GMT+0000 (Coordinated Universal Time)

Saved by @vs #bash

# check if array is empty
if [ ${#array[@]} -gt 0 ]; then
    echo "Array is not empty."
fi
    
# check if array is empty
if [ -z "${array[*]}" ]; then
    echo "Array is not empty."
fi
content_copyCOPY