I'm a fan of awk. Seems to me one awk would do what sed... | cut or tr ...| cut would do - i.e. separate fields on one or more consecutive space characters and allow you to pick the field(s) you want.

Doug

-------- Original Message --------
Subject:        Re: stability of column-widths in output from df, route etc
Date:   Fri, 26 Nov 2010 15:32:42 +0100
From:   walter harms <[email protected]>
Reply-To:       [email protected]
To:     Joakim Tjernlund <[email protected]>
CC:     [email protected]



Am 26.11.2010 13:06, schrieb Joakim Tjernlund:

 On Fri, Nov 26, 2010 at 11:00 AM, David Collier
 <[email protected]>  wrote:
 I have some scripts which manipulate the output of route, and df, by
 using cut -c8-12 or similar to extract the info I want.

 How risky is this - what are the chances of someone making a column wider
 or narrower in a future issue of busybox?

 Is there a better technique?

 Trim all whitespace to single spaces (sed 's/  */ /g'),
 then separate fields on the space char.

 Yes, although it should probably be sed 's/ \+/ /g'


just because i am fan of "tr"
tr -s " "

re,
 wh
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox


_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to