I need to put the output of a command into an associative array.For example:dig mx +short google.comWill return:20 alt1.aspmx.l.google.com.40 alt3.aspmx.l.google.com.50 alt4.aspmx.l.google.com.10 aspmx.l.google.com.30 alt2.aspmx.l.google.com.How can I create an associative array using the priorities (10,20,...) as the key and the record (aspmx.l.google.com.) as the value?
Return the output of a command into an associative array
bash;shell script;associative array