<p dir="ltr"></p>
<p dir="ltr">On Oct 25, 2016 10:54 AM, "Steve Litt" <<a href="mailto:slitt@troubleshooters.com">slitt@troubleshooters.com</a>> wrote:<br>
><br>
> On Fri, 21 Oct 2016 20:00:46 -0400<br>
> Jim Kinney <<a href="mailto:jim.kinney@gmail.com">jim.kinney@gmail.com</a>> wrote:<br>
><br>
> > Parsing text in bash is much harder than in Perl. Associative arrays<br>
> > in bash really help.<br>
><br>
> I didn't know bash had associative arrays. Thanks!<br>
><br>
> =============================<br>
> #!/bin/bash<br>
><br>
> declare -A person<br>
> person[fname]="Steve"<br>
> person[lname]="Litt"<br>
> person[job]="Programmer"<br>
><br>
> echo ${person["job"]}<br>
> =============================<br>
><br>
> Unfortunately, associative arrays are bash-only: No dash allowed.<br>
></p>
<p dir="ltr">Use a single quote around the content string and even spaces, ., and /\ are allowed.<br>
> SteveT<br>
><br>
> Steve Litt<br>
> September 2016 featured book: Twenty Eight Tales of Troubleshooting<br>
> <a href="http://www.troubleshooters.com/28">http://www.troubleshooters.com/28</a><br>
><br>
></p>