Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Aug 2008 14:33:05 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Giorgos Keramidas <keramida@ceid.upatras.gr>
Cc:        freebsd-questions@freebsd.org, David Wolfskill <david@catwhisker.org>
Subject:   Re: Shell scripts: variable assignment within read loops
Message-ID:  <20080818143305.9dd7d096.freebsd@edvax.de>
In-Reply-To: <87ljyvypa8.fsf@kobe.laptop>
References:  <20080818013328.GY44815@bunrab.catwhisker.org> <87ljyvypa8.fsf@kobe.laptop>

next in thread | previous in thread | raw e-mail | index | archive | help
As I thought while reading your message, awk seems to be
a good solution. Just a note:

On Mon, 18 Aug 2008 06:29:03 +0300, Giorgos Keramidas <keramida@ceid.upatras.gr> wrote:
> Would you
> be ok with an awk(1) script instead of /bin/sh?  It tends to be nicer
> for this sort of thing, i.e.:
> 
> [...]
> $ netstat -nibd -f inet | awk -f david.awk

You could start your awk skript with

	#!/usr/bin/awk

and give it +x attribute, as well as adding the desired source
command "netstat -nibd -f inet" to the script, using awk's system()
function, so you can start it more easily or use it in combination
with other commands.

	% ./netstuff.awk


-- 
Polytropon
>From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080818143305.9dd7d096.freebsd>