[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-bash] bash array indirection
From: |
Christof Warlich |
Subject: |
[Help-bash] bash array indirection |
Date: |
Fri, 4 Nov 2016 19:31:54 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 |
Hi,
a quick question: Please consider the following script:
#!/bin/bash
xxx=(hi ho)
indirection=xxx
echo ${!indirection} # Works as expected.
echo address@hidden # Doesn't work. How to print the entire array?
When running, it prints:
hi
0
but I want it to print
hi
hi ho
How do I have to do this properly while still using the indirection?
Thanks for any help,
Chris
- [Help-bash] bash array indirection,
Christof Warlich <=