Date: Mon, 23 Sep 2002 22:24:17 -0400 (EDT) From: Peter Leftwich <Hostmaster@Video2Video.Com> To: Giorgos Keramidas <keramida@ceid.upatras.gr> Cc: FreeBSD LIST <FreeBSD-Questions@FreeBSD.Org> Subject: Re: find case-insensitive challenge [cut/sed] Message-ID: <20020923221952.A20965-100000@earl-grey.cloud9.net> In-Reply-To: <20020923095153.GI1947@hades.hell.gr>
next in thread | previous in thread | raw e-mail | index | archive | help
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? > You can do that with sed(1) too, though: `sed -e 's/\.[^.]*$//'` Can you say in poor-man's terms what the above line does? I used to use `sed -e 's/this/that/g'` often but haven't for a few years now. The way I would remember the command was "sed edit substitute this for that _g_ood we're done" even though I am aware the g is for global. > Both of these should strip the `.xxx' extension of all input lines. > Then, there's Perl, awk, and a few other tools. Practically unlimited > ways of doing the same thing :) > Giorgos. I wonder if there is a book just chock full of sed, awk, cut, and perl examples dissected into layman's terms... :) Maybe an ORA.COM book? -- Peter Leftwich President & Founder Video2Video Services Box 13692, La Jolla, CA, 92039 USA +1-413-403-9555 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?20020923221952.A20965-100000>