Re: [dev] [PATCH] sbase: add cut

2012-08-03 Thread Kurt H Maier
On Sat, Aug 04, 2012 at 01:51:27AM +0100, Connor Lane Smith wrote: > > I don't know about you, but I'd rather use an effective unportable > tool than an ineffective portable one. > I'd rather use an effective portable one, and pretending that doesn't exist doesn't help anything.

Re: [dev] [PATCH] sbase: add cut

2012-08-03 Thread Connor Lane Smith
On 4 August 2012 01:37, Uriel wrote: > Yea, because obviously what we needed is even more unportable GNU extensions. I don't know about you, but I'd rather use an effective unportable tool than an ineffective portable one. cls

Re: [dev] [PATCH] sbase: add cut

2012-08-03 Thread Uriel
On Fri, Aug 3, 2012 at 11:15 PM, Nick wrote: > Quoth Connor Lane Smith: >> % head -n -10 Yea, because obviously what we needed is even more unportable GNU extensions. If this is your only justification for head, it is really sad. > Cool, I didn't know that syntax. Useful. Out of curiousity, i

Re: [dev] [PATCH] sbase: add cut

2012-08-03 Thread Connor Lane Smith
On 4 August 2012 01:01, Strake wrote: > Not sbase head. Maybe someone should file a bug. :p By the way, POSIX tail accepts both positive and negative '-n' arguments, so it would make sense if head did too. One might expect '-c' as well. Unfortunately standards seldom make much sense. cls

Re: [dev] [PATCH] sbase: add cut

2012-08-03 Thread Strake
On 03/08/2012, Connor Lane Smith wrote: > % head -n -10 Not sbase head. $ seq 0 7 | head -n -2 $

Re: [dev] [PATCH] sbase: add cut

2012-08-03 Thread Connor Lane Smith
On 3 August 2012 22:15, Nick wrote: > Cool, I didn't know that syntax. Useful. Out of curiousity, is it > codified in any standard? Sadly not. But then, most things aren't. cls

Re: [dev] [PATCH] sbase: add cut

2012-08-03 Thread Nick
Quoth Connor Lane Smith: > % head -n -10 Cool, I didn't know that syntax. Useful. Out of curiousity, is it codified in any standard?

Re: [dev] [PATCH] sbase: add cut

2012-08-03 Thread Kurt H Maier
On Fri, Aug 03, 2012 at 07:57:38PM +0100, Connor Lane Smith wrote: > On 3 August 2012 19:02, Uriel wrote: > > head(1) is utterly and completely idiotic. sed 11q is superior in > > every possible way. > > % head -n -10 > > % sed -e :a -e '$d;N;2,10ba' -e 'P;D' > > No thanks. > > cls > $ head

Re: [dev] [PATCH] sbase: add cut

2012-08-03 Thread Connor Lane Smith
On 3 August 2012 19:02, Uriel wrote: > head(1) is utterly and completely idiotic. sed 11q is superior in > every possible way. % head -n -10 % sed -e :a -e '$d;N;2,10ba' -e 'P;D' No thanks. cls

Re: [dev] [PATCH] sbase: add cut

2012-08-03 Thread Calvin Morrison
On 3 August 2012 14:02, Uriel wrote: > On Thu, Aug 2, 2012 at 4:34 PM, Kurt H Maier wrote: >> On Thu, Aug 02, 2012 at 10:33:19AM -0400, Calvin Morrison wrote: >>> >>> I think cut is exactly the kind of job that awk (or sed) can be good >>> for. It seems crazy not to use an existing tool that impl

Re: [dev] [PATCH] sbase: add cut

2012-08-03 Thread Uriel
On Thu, Aug 2, 2012 at 4:34 PM, Kurt H Maier wrote: > On Thu, Aug 02, 2012 at 10:33:19AM -0400, Calvin Morrison wrote: >> >> I think cut is exactly the kind of job that awk (or sed) can be good >> for. It seems crazy not to use an existing tool that implements all >> the functionality, that can be

Re: [dev] [PATCH] sbase: add cut

2012-08-02 Thread Jacob Todd
Kill it with fire. On Aug 2, 2012 1:42 PM, "Martin Kopta" wrote: > On 08/02/2012 04:34 PM, Kurt H Maier wrote: > >> On Thu, Aug 02, 2012 at 10:33:19AM -0400, Calvin Morrison wrote: >> >>> >>> I think cut is exactly the kind of job that awk (or sed) can be good >>> for. It seems crazy not to use a

Re: [dev] [PATCH] sbase: add cut

2012-08-02 Thread Martin Kopta
On 08/02/2012 04:34 PM, Kurt H Maier wrote: On Thu, Aug 02, 2012 at 10:33:19AM -0400, Calvin Morrison wrote: I think cut is exactly the kind of job that awk (or sed) can be good for. It seems crazy not to use an existing tool that implements all the functionality, that can be nicely bundled in

Re: [dev] [PATCH] sbase: add cut

2012-08-02 Thread Kurt H Maier
On Thu, Aug 02, 2012 at 10:33:19AM -0400, Calvin Morrison wrote: > > I think cut is exactly the kind of job that awk (or sed) can be good > for. It seems crazy not to use an existing tool that implements all > the functionality, that can be nicely bundled in a a script. > To be honest, I feel th

Re: [dev] [PATCH] sbase: add cut

2012-08-02 Thread Calvin Morrison
On 2 August 2012 07:31, Martin Kopta wrote: > On 08/02/2012 01:20 PM, hiro wrote: >> >> why not a C-to-awk compiler? > > > Written in Perl. NOW we are finally getting somewhere. > > I think cut is exactly the kind of job that awk (or sed) can be good for. It seems crazy not to use an existing too

Re: [dev] [PATCH] sbase: add cut

2012-08-02 Thread Martin Kopta
On 08/02/2012 01:20 PM, hiro wrote: why not a C-to-awk compiler? Written in Perl. NOW we are finally getting somewhere.

Re: [dev] [PATCH] sbase: add cut

2012-08-02 Thread hiro
why not a C-to-awk compiler?

Re: [dev] [PATCH] sbase: add cut

2012-08-02 Thread Paul Onyschuk
On Wed, 1 Aug 2012 22:49:05 -0400, Steven Blatchford wrote: > > I wanted to know how you use awk to get the same output as > "cut -d' ' -f3-" > This can be done on multiple ways in awk, here is one example (a bit extreme): awk '{$1=$2=""; $0=substr($0, 3)}1' -- Paul Onyschuk

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Steven Blatchford
On 00:12 Thu 02 Aug, sjferr...@gmail.com wrote: >> On 19:52 Wed 01 Aug, Kurt H Maier wrote: >>>On Wed, Aug 01, 2012 at 07:28:57PM -0400, Steven Blatchford wrote: What is your awk to print fields three and four with this input: 'foo bar baz quz' >>> >>>Depends on what

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread sjferrara
> On 19:52 Wed 01 Aug, Kurt H Maier wrote: >>On Wed, Aug 01, 2012 at 07:28:57PM -0400, Steven Blatchford wrote: >>> >>> What is your awk to print fields three and four with this input: >>> >>> 'foo bar baz quz' >>> >> >>Depends on what output format I want. Get to the point instead of >>try

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Steven Blatchford
On 19:52 Wed 01 Aug, Kurt H Maier wrote: >On Wed, Aug 01, 2012 at 07:28:57PM -0400, Steven Blatchford wrote: >> >> What is your awk to print fields three and four with this input: >> >> 'foo bar baz quz' >> > >Depends on what output format I want. Get to the point instead of >trying to set

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Strake
On 01/08/2012, Kurt H Maier wrote: > In fact, I'm fairly > certain I could implement cut in sed. with shell script wrapper?

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Kurt H Maier
On Wed, Aug 01, 2012 at 08:33:14PM -0400, Andrew Hills wrote: > On Wed, Aug 1, 2012 at 6:54 PM, Kurt H Maier wrote: > > The question is: since cut can be implemented IN awk, why should it get > > a separate C binary? Anyone nattering about performance in a shell > > script is barking up the wrong

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Andrew Hills
On Wed, Aug 1, 2012 at 6:54 PM, Kurt H Maier wrote: > The question is: since cut can be implemented IN awk, why should it get > a separate C binary? Anyone nattering about performance in a shell > script is barking up the wrong tree. Should sed be excluded? What can you do with sed that you can'

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Kurt H Maier
On Wed, Aug 01, 2012 at 07:28:57PM -0400, Steven Blatchford wrote: > > What is your awk to print fields three and four with this input: > > 'foo bar baz quz' > Depends on what output format I want. Get to the point instead of trying to set me up for failure; I don't have time for this shit

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Steven Blatchford
On 19:21 Wed 01 Aug, Kurt H Maier wrote: >On Wed, Aug 01, 2012 at 07:13:57PM -0400, Steven Blatchford wrote: >> >> Give this[0] a read and see what you think. >> >> [0] http://awk.freeshell.org/RangeOfFields >> > >I think their suggestions are based on > 1) deciding to use a shitty version of aw

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Kurt H Maier
On Wed, Aug 01, 2012 at 07:13:57PM -0400, Steven Blatchford wrote: > > Give this[0] a read and see what you think. > > [0] http://awk.freeshell.org/RangeOfFields > I think their suggestions are based on 1) deciding to use a shitty version of awk, and 2) the idea that you should give a shit i

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Steven Blatchford
On 18:54 Wed 01 Aug, Kurt H Maier wrote: >On Wed, Aug 01, 2012 at 11:02:52PM +0100, Nick wrote: >> >> Bah. There's a balance to be struck. Scripts which aren't awful >> should be supported. The issue is whether using cut constitutes >> 'awful'. I think it does not. There are legitimate cases whe

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread hiro
because suckless lol On 8/2/12, Kurt H Maier wrote: > On Wed, Aug 01, 2012 at 11:02:52PM +0100, Nick wrote: >> >> Bah. There's a balance to be struck. Scripts which aren't awful >> should be supported. The issue is whether using cut constitutes >> 'awful'. I think it does not. There are legitimat

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Kurt H Maier
On Wed, Aug 01, 2012 at 11:02:52PM +0100, Nick wrote: > > Bah. There's a balance to be struck. Scripts which aren't awful > should be supported. The issue is whether using cut constitutes > 'awful'. I think it does not. There are legitimate cases where it's > simpler and clearer than awk/sed. >

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Nick
Quoth Uriel: > On Wed, Aug 1, 2012 at 4:04 PM, Ryan Mullen wrote: > > > > Exclusion of cut would make sbase not viable when existing scripts > > need to be supported. > > Exclusion of bash would make sbase not viable when existing scripts > need to be supported. > > What a lame argument. Bah. T

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Uriel
On Wed, Aug 1, 2012 at 3:18 PM, Martin Kopta wrote: > On 08/01/2012 03:09 PM, Kurt H Maier wrote: >> >> On Wed, Aug 01, 2012 at 08:58:00AM -0400, Niki Yoshiuchi wrote: >>> >>> Why would you use awk or Perl when you have the best programming language >>> available: Ruby? >>> On Aug 1, 2012 8:55 AM,

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Uriel
On Wed, Aug 1, 2012 at 4:04 PM, Ryan Mullen wrote: > > Exclusion of cut would make sbase not viable when existing scripts > need to be supported. Exclusion of bash would make sbase not viable when existing scripts need to be supported. What a lame argument. Uriel

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread hiro
sometimes I only respond to the suckless becaus I want to annoy you with my top-posts, although I have nothing to say whatsoever. On 8/1/12, Ryan Mullen wrote: > Hi, > > On Wed, Aug 1, 2012 at 10:23 AM, pancake wrote: >> The only thing i miss in cut is mutichar word split. Which is properly >> h

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Ryan Mullen
Hi, On Wed, Aug 1, 2012 at 10:23 AM, pancake wrote: > The only thing i miss in cut is mutichar word split. Which is properly > handled by awk. For example: > > If a line is splitted by multiple spaces or a mix of tabs and spaces it is > not handled right by cut. But awk does the job. This is s

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread pancake
The only thing i miss in cut is mutichar word split. Which is properly handled by awk. For example: If a line is splitted by multiple spaces or a mix of tabs and spaces it is not handled right by cut. But awk does the job. That's quite anoying because of the crappy output of many tools that abu

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Nick
Quoth Ryan Mullen: > Exclusion of cut would make sbase not viable when existing scripts > need to be supported. Exactly. I only use awk to do these kind of jobs nowadays, but cut is in use a lot of places, so it makes sense to use it. And it can be easier for certain kinds of jobs (e.g. printing

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Ryan Mullen
HI, On Wed, Aug 1, 2012 at 9:48 AM, Strake wrote: > I rewrote cut cleaner, but am not sure whether I ought to bother to > send it, if ye would rather keep sbase sans cut. IMO cut is a good tool to include. I use cut's functionality much more than awk's; it's a simpler tool that does a basic thin

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Strake
I rewrote cut cleaner, but am not sure whether I ought to bother to send it, if ye would rather keep sbase sans cut.

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Strake
On 01/08/2012, Martin Kopta wrote: >> Also, I'm really curious why people use cut when awk exists. > > $ du -b /usr/bin/cut /usr/bin/gawk /opt/plan9/bin/awk > 38600 /usr/bin/cut > 400212 /usr/bin/gawk > 105700 /opt/plan9/bin/awk > > Speed and simplicity I guess? > > Why would I use awk of whic

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Martin Kopta
On 08/01/2012 03:09 PM, Kurt H Maier wrote: On Wed, Aug 01, 2012 at 08:58:00AM -0400, Niki Yoshiuchi wrote: Why would you use awk or Perl when you have the best programming language available: Ruby? On Aug 1, 2012 8:55 AM, "Martin Kopta" wrote: On 08/01/2012 02:36 PM, Uriel wrote: Use awk.

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Christoph Lohmann
Greetings. On Wed, 01 Aug 2012 15:10:19 +0200 Niki Yoshiuchi wrote: > Why would you use awk or Perl when you have the best programming language > available: Ruby? > On Aug 1, 2012 8:55 AM, "Martin Kopta" wrote: > > > On 08/01/2012 02:36 PM, Uriel wrote: > > > >> Use awk. > >> > > > > Use Perl.

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Kurt H Maier
On Wed, Aug 01, 2012 at 08:58:00AM -0400, Niki Yoshiuchi wrote: > Why would you use awk or Perl when you have the best programming language > available: Ruby? > On Aug 1, 2012 8:55 AM, "Martin Kopta" wrote: > > > On 08/01/2012 02:36 PM, Uriel wrote: > > > >> Use awk. > >> > > > > Use Perl. > > >

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Niki Yoshiuchi
Why would you use awk or Perl when you have the best programming language available: Ruby? On Aug 1, 2012 8:55 AM, "Martin Kopta" wrote: > On 08/01/2012 02:36 PM, Uriel wrote: > >> Use awk. >> > > Use Perl. > > >

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Martin Kopta
On 08/01/2012 02:36 PM, Uriel wrote: Use awk. Use Perl.

Re: [dev] [PATCH] sbase: add cut

2012-08-01 Thread Uriel
Use awk. On Wed, Aug 1, 2012 at 6:07 AM, Strake wrote: > Will now need libutf. > > diff -r 8cf300476909 Makefile > --- a/Makefile Sat Jun 09 18:53:39 2012 +0100 > +++ b/Makefile Tue Jul 31 23:06:28 2012 -0500 > @@ -27,6 +27,7 @@ > cksum.c\ > cmp.c \ > cp.c

[dev] [PATCH] sbase: add cut

2012-07-31 Thread Strake
Will now need libutf. diff -r 8cf300476909 Makefile --- a/Makefile Sat Jun 09 18:53:39 2012 +0100 +++ b/Makefile Tue Jul 31 23:06:28 2012 -0500 @@ -27,6 +27,7 @@ cksum.c\ cmp.c \ cp.c \ + cut.c \ date.c \ dirname.c \