From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: From: Teodoro Santoni Date: Thu, 26 Apr 2018 17:02:07 +0200 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset="UTF-8" Subject: Re: [9fans] simple rc problem in p9p (on OpenBSD) Topicbox-Message-UUID: d4a8555a-ead9-11e9-9d60-3106f5b1d025 Hi, 2018-04-26 16:45 GMT+02:00, Rudolf Sykora : > Hello > > I, using OpenBSD's p9p, see this > > % w='A > B > C' > % echo $w > A > B > C > % for(i in $w) {echo $i; echo XXX} > A > B > C > XXX > > ie, w in for is taken as just one argument instead of > 3. What can I do with it? > > I haven't modified ifs (it should be \n space and tab). > (How can I check, say see the character codes?) > > Thanks for comments > Ruda > > ; w='A B C' ; we=`{echo $w} ; for(i in $we) { echo 'arg '$i; } arg A arg B arg C ; for(i in $w) { echo 'arg'$i; } argA B C ; exit When enclosed in single quotes, the variable is, regardless of spaces or whatnot, a single element. For a list you have to expand it in some way, inside a command expansion or declaring a list.