From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <6f978044f0c96ef2c9fb670d2b79d03a@quintile.net> From: "Steve Simon" Date: Mon, 18 Dec 2006 11:33:57 +0000 To: 9fans@cse.psu.edu MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] silly rc quoting question Topicbox-Message-UUID: f5c1b63a-ead1-11e9-9d60-3106f5b1d025 I have realised I don't understand rc's quoting rules as well as I thought I did. I want to parse the output of a program which has one record per line, and white space delimited fields in each line. Some fields have whitespace in them but if they do then these fields are surrounded in quotes; here I will use cat and a file as an example, in "real life" its all a bit more complex. term% cat junk f1 f2 'free text' f4 I expect when I parse this using the backquote operator then the quoting would be respected, this appears not to be the case: term% cat junk | while(a=`{read}){ echo $#a echo $a(3) } 5 'free Where as I would expect: 4 free text I know I cannot do this with awk (unless I build the parser in awk (ugh)). Having said this I have been tempted to produce a non-standard, awk9 which understands plan9's unified quoting rules, even things like ls -l | awk '{print $6, $10}' are not reliable given whitespace in file names. Is it possible to use rc to parse data using rc's rules? -Steve