From owner-freebsd-questions@FreeBSD.ORG Thu Feb 26 06:30:21 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7CE2816A4DB for ; Thu, 26 Feb 2004 06:30:21 -0800 (PST) Received: from wonkity.com (wonkity.com [65.173.111.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2C87143D1F for ; Thu, 26 Feb 2004 06:30:21 -0800 (PST) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.12.10/8.12.10) with ESMTP id i1QEUKNH099183; Thu, 26 Feb 2004 07:30:20 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.12.10/8.12.10/Submit) with ESMTP id i1QEUJqL099180; Thu, 26 Feb 2004 07:30:20 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Thu, 26 Feb 2004 07:30:19 -0700 (MST) From: Warren Block To: =?iso-8859-2?Q?Roub=ED=E8ek_Zden=ECk_=28T-Systems_PragoNet=29?= In-Reply-To: <9256D57F598E6C41B288AA7DB94F29C901C2D69A@pgnmail1.pgnaplikace.cz> Message-ID: <20040226072518.N99054@wonkity.com> References: <9256D57F598E6C41B288AA7DB94F29C901C2D69A@pgnmail1.pgnaplikace.cz> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN Content-Transfer-Encoding: QUOTED-PRINTABLE cc: questions@freebsd.org Subject: Re: Problem with sed and awk X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Feb 2004 14:30:21 -0000 On Thu, 26 Feb 2004, [iso-8859-2] Roub=ED=E8ek Zden=ECk (T-Systems PragoNet= ) wrote: > Any idea what I am missing? You don't say what you are expecting these awk samples to do... > >cat test ^^^^ There is a command called test, so you should not use that name for test files. > 1;1 > 2;2 > >awk -F ';' '{print $1}' > 1 > 2 This is doing what you've told it. The field separator is ; and it prints the first field on each line (assuming you are actually running it on the 'test' file--the command as shown won't do it). > >awk -F ' FS=3D";" {print $1}' > 1;1 > 2 Don't use the -F option if you are setting the field separator inside the code. -Warren Block * Rapid City, South Dakota USA