I'd do this like:
#!/bin/bash
python -c '
import sys
for line in sys.stdin:
fields = line.split()
count =0
for field in fields[1:]:
upper = field.upper()
print(upper)
if upper == "NA":
count += 1
print("{} {}".format(fields[0], count))
'
On Saturday, February 13, 2016 at 10:42:37 PM UTC-8, konsolebox wrote:
> Hi Chet,
>
> Please consider adding a mirror of bash's git repo in github.com. It
> would be easier for many people in the community to contribute code
> and discuss it there.
Chet probably has his own thoughts on this, but
On Mon, Feb 15, 2016 at 1:53 AM, wrote:
> On Saturday, February 13, 2016 at 10:42:37 PM UTC-8, konsolebox wrote:
>> Hi Chet,
>>
>> Please consider adding a mirror of bash's git repo in github.com. It
>> would be easier for many people in the community to contribute code
>> and discuss it there.
I seem to remember some discussion of this before --
not being able to use -v to check if a hash was defined,
but having it "work"(?) w/arrays?
I think, though, the fact that it operates inconsistently
makes it a bug. I.e. if always work or fail, at least it
is behaving consistently, feels wrong