Array of arrays in bash
I'm attempting to read an input file line by line which contains fields delimited by periods. I want to put them into an array of arrays so I can loop through them later on. The input appears to be ok, but 'pushing' that onto the array (inData) doesn't appear to be working. The code goes : Input file: GSDB.GOSALESDW_DIST_INVENTORY_FACT.MONTH_KEY GSDB.GOSALESDW_DIST_INVENTORY_FACT.ORGANIZATION_KEY infile=${1} OIFS=$IFS IFS=":" cat ${infile} | while read line do line=${line//\./:} inarray=(${line}) # echo ${inarray[@]} # echo ${#inarray[@]} # echo ${inarray[0]} # echo ${inarray[1]} # echo ${inar
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.