I have an array which gets filled with different error messages as my script runs. I need a way to check if it is empty of not at the end of the script and take a specific action if it is. I have already tried treating it like a normal VAR and using -z to check it, but that does not seem to work. Is there a way to check if an array is empty or not in Bash?
![Check if array is empty in Bash](https://cdn-ak-scissors.b.st-hatena.com/image/square/1d7824625a3ecbc3a39062b14aaa9db8a44aa022/height=288;version=1;width=512/https%3A%2F%2Fcdn.sstatic.net%2FSites%2Fserverfault%2FImg%2Fapple-touch-icon%402.png%3Fv%3D9b1f48ae296b)