Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Problem with arrays -- "unknown file attribute"



Hi zsh list again,

I have a problem converting a whitespace string to an array.  See XXX
in code below (which takes the list of tables generated by sqlite and
tries to parse and iterate over them).  Everything I try to go from
text to array either doesn't convert to an array or gives some funky
error.  Please help, before I revert to my old bash ways !!

pop-colnames () {
    IFS=
    setopt errreturn
    TABS=( $(sqlite3 $DB .tables) ) # XXX
    for TAB in ($TABS); do
        echo \"$TAB\"
        for COL in $COLS; do
            echo $COL
            #sqlite3 $DB "insert into row_meta (tname, colname) values
($TAB, ${COL//\"/});"
        done
    done
}

(0) foobar:NLSY [0]% pop-colnames
pop-colnames:4: unknown file attribute

Here is what sqlite does by itself:

(0) foobar:NLSY [0]% sqlite3 ICPSR_04683/NLSY.db .tables
DS0001  DS0003  DS0005  DS0007  DS0009  DS0011  DS0013  DS0015  DS0017  DS0019
DS0002  DS0004  DS0006  DS0008  DS0010  DS0012  DS0014  DS0016  DS0018  DS0020

Thanks!



Messages sorted by: Reverse Date, Date, Thread, Author