Languages
[Edit]
EN

Bash - create array

3 points
Created by:
Teilsa
1315

This article, we would like to show you how to create an array in Bash.

There are several ways to create an array in Bash:

  1. by using array syntax:
    or:
  2. by using declare command:
  3. by assigning single values:
    Note: when we try to assign values to non-existing array the array is created automatically.

 

Usage example

Edit

Output:

 

See also

Edit
  1. Bash - iterate through array values
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

Bash

Bash - create array
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join