Gentoo Archives: gentoo-user

From: Hans-Werner Hilse <hilse@×××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] OT: awk scripting
Date: Fri, 24 Mar 2006 15:22:07
Message-Id: 20060324154313.c8ac0845.hilse@web.de
In Reply to: [gentoo-user] OT: awk scripting by Sascha Lucas
1 Hi,
2
3 On Fri, 24 Mar 2006 14:34:22 +0100 (CET) Sascha Lucas
4 <sascha.lucas@×××××××××××××××××.de> wrote:
5
6 > I want the awk analogon for "cut -f2-", which prints fields #2 to #n.
7 > Is this possible?
8 >
9 > awk '{print $2???}'
10
11 I'd do the following:
12
13 awk '{$1="";print $0}'
14
15 (awk recalculates $0 when $n is modified)
16 This still leaves you with one OFS starting the line (between $1 and
17 $2), you can get rid of this using
18
19 awk '{$1="";print substr($0,lenght(OFS))}'
20
21
22 -hwh
23 --
24 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] OT: awk scripting Sascha Lucas <sascha.lucas@×××××××××××××××××.de>