From owner-freebsd-questions Fri Feb 1 9:34:15 2002 Delivered-To: freebsd-questions@freebsd.org Received: from pc1-dale5-0-cust136.not.cable.ntl.com (pc1-dale5-0-cust136.not.cable.ntl.com [80.1.76.136]) by hub.freebsd.org (Postfix) with SMTP id 6F37C37B402 for ; Fri, 1 Feb 2002 09:34:12 -0800 (PST) Received: (qmail 48225 invoked from network); 1 Feb 2002 17:34:02 -0000 Received: from localhost (HELO matt.thebigchoice.com) (127.0.0.1) by localhost with SMTP; 1 Feb 2002 17:34:02 -0000 Date: Fri, 1 Feb 2002 17:34:01 +0000 From: Matt H To: "adrian kok" Cc: freebsd-questions@FreeBSD.ORG Subject: Re: help about awk Message-Id: <20020201173401.55a1ad75.freebsd-questions@cuntbubble.com> In-Reply-To: <20020201170553.35965.qmail@web21209.mail.yahoo.com> References: <20020201170553.35965.qmail@web21209.mail.yahoo.com> X-Mailer: Sylpheed version 0.7.0 (GTK+ 1.2.10; i386--freebsd4.4) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, 2 Feb 2002 01:05:53 +0800 (CST) "adrian kok" wrote: > Hi all > > Could you teach me how to get (data1, data2) from the > following pattern? make a file (t.awk for instance) BEGIN { FS="'" } { print $6 } then %echo "mail home (100,00,000,'1111-2','89','data1');" | awk -f t.awk data1 % replace the echo ".." with cat filename and you're away I couldn't work out how to escape the ' in bash but making the t.awk file means I didn't have to To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message