Re: [Toybox] Has anybody ever actually used cut -f?

2016-09-02 Thread Rob Landley
On 09/02/2016 03:26 AM, Bastian Bittorf wrote: > what about using 'set', it already default to your > [any spaces also TABS] because of IFS. so: > > set -- one two three four five; echo $2 $3 $4 > > i has two downsides: > 1) it's not intuitive > 2) it overwrites the ARGS 3) It's processing

Re: [Toybox] Has anybody ever actually used cut -f?

2016-09-02 Thread Bastian Bittorf
* Rob Landley [02.09.2016 09:44]: > In theory: > > echo "one two three four five" | cut -f 2-4 [...] > As has been noted before, this makes about 90% of the uses of awk go > away. The downside is, if you're _not_ using toybox cut, it won't work. Dont do that. I understand

Re: [Toybox] Has anybody ever actually used cut -f?

2016-09-02 Thread Mike Moreton
Like Samuel I tend to use sed and cut rather than awk - I think most people find a set of tools that works for them, and then stick with it. I think it would be better to keep existing behaviour by default, and add a new option for the new behaviour (-F?). Mike.

Re: [Toybox] Has anybody ever actually used cut -f?

2016-09-01 Thread scsijon
Message: 2 Date: Thu, 1 Sep 2016 15:29:28 -0500 From: Samuel Holland <sam...@sholland.org> To: toybox@lists.landley.net, Rob Landley <r...@landley.net> Subject: Re: [Toybox] Has anybody ever actually used cut -f? Message-ID: <9926c62a-75da-0f1c-885e-323cb33c3...@sholland.or

Re: [Toybox] Has anybody ever actually used cut -f?

2016-09-01 Thread enh
On Thu, Sep 1, 2016 at 2:23 PM, Rob Landley wrote: > > On 09/01/2016 03:29 PM, Samuel Holland wrote: > > Hello, > > > > On 09/01/2016 02:58 PM, Rob Landley wrote: > >> In theory: > >> > >> echo "one two three four five" | cut -f 2-4 > >> > >> Should be really useful, and mean

Re: [Toybox] Has anybody ever actually used cut -f?

2016-09-01 Thread Rob Landley
On 09/01/2016 03:29 PM, Samuel Holland wrote: > Hello, > > On 09/01/2016 02:58 PM, Rob Landley wrote: >> In theory: >> >> echo "one two three four five" | cut -f 2-4 >> >> Should be really useful, and mean you don't need awk. In practice, >> posix specifies that the default separator of cut -f is

[Toybox] Has anybody ever actually used cut -f?

2016-09-01 Thread Rob Landley
In theory: echo "one two three four five" | cut -f 2-4 Should be really useful, and mean you don't need awk. In practice, posix specifies that the default separator of cut -f is TAB, and that the -d delimiter specifier has no way to specify 'arbitrary run of whitespace'. So I propose 2