Chunk Array

Split an array into smaller chunks of a specified size.

Code

General
echo "$arr" | tr -d '[]' | tr ',' '\n' | xargs -n "$size"

Parameters

JSON array to chunk

Size of each chunk

Server

More Bash Snippets