[refactor] Use `bash_impl` to print arrays (#2219)