From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Wed, 22 Jun 2011 12:21:04 -0400 To: 9fans@9fans.net Message-ID: <3f1ba6307644fecb39cef428f3cb0bf4@ladd.quanstro.net> In-Reply-To: <0d34ca37980c4db0a99135f256c7d8aa@terzarima.net> References: <0d34ca37980c4db0a99135f256c7d8aa@terzarima.net> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] rc niggle, and proposed fix Topicbox-Message-UUID: f3aea380-ead6-11e9-9d60-3106f5b1d025 On Wed Jun 22 12:00:07 EDT 2011, forsyth@terzarima.net wrote: > >ifs seems a holdover. it's only ever used in `{} yet > >it's a global inherited variable. so it's easy to write > >a script that assumes that ifs is set to the default. >=20 > i wonder if it's best left alone. it isn't detailed enough > to crack many plausible formats, for instance full csv. > if i needed one of those formats to feed into a `{} i'd add > a filter that converted to quoted & space-separated fields > that the default ifs would crack. yes. rc splitting is limiting, and i'd love a better idea. my argument isn't that this is great, but that it is better. like the type system in c. :-) as a lame example, ... the word splitting in `{} is good enough to handle many formats, including splitting by na=C3=AFve word and line. at one point i rewrite iwhois to handle other registrars than network solutions, and it was very handy to have these functions fn split{ ifs=3D. x=3D`{echo -n $*} echo $x } fn permute{ while(! ~ $#* 0){ echo $*|sed 's/ /./g' shift } } to walk through whois databases for names like x.y.example.com.au to find the registered name without having a database of which database operates at which level. - erik