% cat gtest #!/dis/sh load std csv nums=() fn groupcontents { (fld1 fld2)=$* echo $fld2 nums=$nums $fld2 echo $nums } { echo a,1 echo b,2 echo c,3 } | getcsv {groupcontents $line } echo end of file: $nums % ./gtest 1 1 2 1 2 3 1 2 3 end of file: %