From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Sat, 3 Apr 2010 10:38:11 -0400 To: 9fans@9fans.net Message-ID: <79bfa351ebdb8906c17ec13976aa3e15@ladd.quanstro.net> In-Reply-To: <341DF8C2-A223-49A7-AA6C-65B7FB4C1CF5@fastmail.fm> References: <341DF8C2-A223-49A7-AA6C-65B7FB4C1CF5@fastmail.fm> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] rc word splitting trouble Topicbox-Message-UUID: fbf859b0-ead5-11e9-9d60-3106f5b1d025 > % fullloc = '/one/two?three+four' > % params = `{echo $fullloc | sed -e 's;.*\?;;' -e 's;\+; ;g'} > % for(param in $params) echo '
  • '$"param >
  • three >
  • four > > The 2nd and 3rd command lines are copied directly from the script, but > the script itself outputs the following: > >
  • three four > > The sed expressions appear to be working correctly, to my eyes, so I > don't understand what's going on. i suspect your ifs is set to something funky. inserting a "whatis params" in your script would be pretty interesting. note that gnu sed will eat your regular expression since you \? is their meta character. you can accomplish something that's equivalent in rc without an explicit loop: echo '
  • ' ^ $params - erik