Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Problem with arrays -- "unknown file attribute"
- X-seq: zsh-users 13636
- From: "Webb Sprague" <webb.sprague@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Problem with arrays -- "unknown file attribute"
- Date: Mon, 5 Jan 2009 00:04:36 -0800
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=iPapiJDs3torMsCEzQVqMK/INmuK6s+Pqtm8LxiklM4=; b=myddZeWI2/YdMDLvQFwqNQvto8sfRVoDpu6eXDJQdBxAldFgBk6Ci33EXRxBRW0/jb vQussEGj25JEBff9keY3jXkHAx+wSkK0nmJIO6EJKq9CyVsI/5/HUXZKYuBfth09E8Rf i85dWfsXkKv+3h2ZWZ20k4k+6Ituc1f4Nnr18=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=h+dz3cRARN71EDKILHKmXufQVPYqgMQelyQD8Iz2ly/XD0rD+ktg3GD1dwzQlZa1eR PPH18b5dipPBZ1QfYgnAbF1Ce3kaZNRKZEZKCqwZHMq82sz5E1ulKrliindpkRFC8DQK k2u1Jyoww8TMM25CnkV/SgtciGf7yrHd99FNQ=
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
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