SyntaxFix
Write A Post
Hire A Developer
Questions
You can use
my_array=( $(<command>) )
to store the output of command <command> into the array my_array.
<command>
my_array
You can access the length of that array using
my_array_length=${#my_array[@]}
Now the length is stored in my_array_length.
my_array_length