|
| From: | lxnf98mm |
| Subject: | [Help-bash] howto pass bash array to bc |
| Date: | Wed, 8 Aug 2012 12:38:51 -0500 (CDT) |
| User-agent: | Alpine 2.00 (LRH 1167 2008-08-23) |
I know this is not strickly bash but ...If I have a bash array, a=("1" "2" "3"), and I want to pass this array to bc for some computations, how do I/can I do this?
echo "\
define z(a[]) {
j = 1;
print a[j];
}
z(address@hidden)" | bc -l
Richard
| [Prev in Thread] | Current Thread | [Next in Thread] |