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

From: <sjferrara_AT_gmail.com>
Date: Thu, 2 Aug 2012 00:12:08 -0300

> 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 me up for failure; I don't have time for this shit
>
> I wanted to know how you use awk to get the same output as
> "cut -d' ' -f3-"

awk '{for (i=3; i<=NF; i++) printf "%s ", $i} END {print}'


> Also what about "cut -d' ' -f1,3,9-" ?

awk '{printf "%s %s ", 1, 3; for (i=9; i<=NF; i++) printf "%s ", $i} END {print}'
Received on Thu Aug 02 2012 - 05:12:08 CEST

This archive was generated by hypermail 2.3.0 : Thu Aug 02 2012 - 05:24:04 CEST