From owner-freebsd-questions Mon Sep 23 20:31:58 2002 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 D733437B401 for ; Mon, 23 Sep 2002 20:31:56 -0700 (PDT) Received: from mta7.pltn13.pbi.net (mta7.pltn13.pbi.net [64.164.98.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9914343E75 for ; Mon, 23 Sep 2002 20:31:56 -0700 (PDT) (envelope-from mbsd@pacbell.net) Received: from atlas ([64.168.24.85]) by mta7.pltn13.pbi.net (iPlanet Messaging Server 5.1 (built May 7 2001)) with ESMTP id <0H2X00ARDB57TZ@mta7.pltn13.pbi.net> for questions@freebsd.org; Mon, 23 Sep 2002 20:31:56 -0700 (PDT) Date: Mon, 23 Sep 2002 20:31:55 -0700 (PDT) From: =?ISO-8859-1?Q?Mikko_Ty=F6l=E4j=E4rvi?= Subject: Re: find case-insensitive challenge [cut/sed] In-reply-to: <1032836037.24108.218.camel@duncan> X-X-Sender: mikko@atlas.home To: questions@freebsd.org Message-id: <20020923202144.K17757-100000@atlas.home> 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 24 Sep 2002, Duncan Anker wrote: > On Tue, 2002-09-24 at 12:24, Peter Leftwich wrote: > > On Mon, 23 Sep 2002, Giorgos Keramidas wrote: > > > On 2002-09-22 21:53, Peter Leftwich wrote: > > > > That leads me to wonder about using "rev" to reverse the order of > > > > characters on the line and "cut" using a field delimiter of "." :) :) > > > You probably could, and then use rev to fix the lines back to their > > > normal form too. `rev | cut -d. -f2- | rev` > > > > I definitely favor "cut." How common across the various Unices/Unixes is > > cut, that is, does Sun/Solaris or Linux come with cut included? > > It's been on every box I've tried to use it on - SunOS, Solaris, Digital > UNIX, AIX, FreeBSD, Linux ... It wasn't available on 4.2 BSD (on a VAX) where I first started using unix -- cut was a SysV:ism. I don't think Ultrix had it either, and on SunOS 4 it was delegated to /usr/5bin. Nowadays, cut is part of SUSv2 and later, so pretty much every system should have it. [...] > You might also want to pick up a copy of "Mastering Regular > Expressions." Yes! Highly recommended. Maybe a bit overkill as a primer on using sed, though... ;-) $.02, /Mikko To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message