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

From: Steven Blatchford <dollarsignfoo_AT_gmail.com>
Date: Wed, 1 Aug 2012 23:53:57 -0400

On 00:12 Thu 02 Aug, sjferrara_AT_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 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}'
>
I think you mean '... END {printf "\n"}' but even with this you have a
trailing space.
Received on Thu Aug 02 2012 - 05:53:57 CEST

This archive was generated by hypermail 2.3.0 : Thu Aug 02 2012 - 06:00:06 CEST