Bash: declare, echo: Display Associative Array

nick3499
1 min readFeb 21, 2017

--

declare -a nintendo_value declares a variable to be given attributes. -a flag is followed by an array variable name. nintendo64_value=([clay_fighter]='174.99 USD' [turok_rage]='124.99 USD') assigns two attributes (the prices of video games) to the declared variable. echo 'Price: Turok Rage Wars Gray: ${nintendo64_value[turok_rage]}' displays the price of a video game including descriptive string.

--

--

nick3499
nick3499

Written by nick3499

coder of JavaScript and Python

No responses yet