From owner-freebsd-questions@FreeBSD.ORG Sat Jan 31 16:44:34 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 8B63B16A4CE for ; Sat, 31 Jan 2004 16:44:34 -0800 (PST) Received: from lilzmailso01.liwest.at (lilzmailso01.liwest.at [212.33.55.23]) by mx1.FreeBSD.org (Postfix) with ESMTP id BC2A343D1F for ; Sat, 31 Jan 2004 16:44:33 -0800 (PST) (envelope-from dgw@liwest.at) Received: from cm58-27.liwest.at ([212.33.58.27]) by lilzmailso01.liwest.at with esmtp (Exim 4.24) id 1An5iz-0002iT-0u for questions@freebsd.org; Sun, 01 Feb 2004 01:44:33 +0100 From: Daniela To: questions@freebsd.org Date: Sun, 1 Feb 2004 01:38:44 +0000 User-Agent: KMail/1.5.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200402010138.44102.dgw@liwest.at> Subject: OT: sed problem 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: Sun, 01 Feb 2004 00:44:34 -0000 I was wondering how I can do the following with sed (or another program): 1. Output only the text from the start of the line to the first pipe character 2. Output only the text between the last and the previous pipe character Or, split the line at the pipe characters and assign the parts to different shell variables. Regards, Daniela