Date: Mon, 23 Sep 2002 20:31:55 -0700 (PDT) From: =?ISO-8859-1?Q?Mikko_Ty=F6l=E4j=E4rvi?= <mbsd@pacbell.net> To: questions@freebsd.org Subject: Re: find case-insensitive challenge [cut/sed] Message-ID: <20020923202144.K17757-100000@atlas.home> In-Reply-To: <1032836037.24108.218.camel@duncan>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <Hostmaster@Video2Video.Com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020923202144.K17757-100000>