Date: Mon, 18 Aug 2008 15:55:14 +0300 From: Giorgos Keramidas <keramida@ceid.upatras.gr> To: Polytropon <freebsd@edvax.de> Cc: freebsd-questions@freebsd.org, David Wolfskill <david@catwhisker.org> Subject: Re: Shell scripts: variable assignment within read loops Message-ID: <87wsielbyl.fsf@kobe.laptop> In-Reply-To: <20080818143305.9dd7d096.freebsd@edvax.de> (Polytropon's message of "Mon, 18 Aug 2008 14:33:05 %2B0200") References: <20080818013328.GY44815@bunrab.catwhisker.org> <87ljyvypa8.fsf@kobe.laptop> <20080818143305.9dd7d096.freebsd@edvax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 18 Aug 2008 14:33:05 +0200, Polytropon <freebsd@edvax.de> wrote: > 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 That's an option, but piping *to* awk may be slightly trickier then.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?87wsielbyl.fsf>