Fill Array

Create an array filled with a specific value.

Code

General
jq -n --argjson len "$length" --argjson val "$value" '[$val] * $len'

Parameters

Length of the array

Value to fill with (JSON)

Server

More Bash Snippets