linc on 31 Aug 2010 09:23:55 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Sed or awk help?!


Walt Mankowski wrote:
On Tue, Aug 31, 2010 at 12:11:50PM -0400, linc wrote:
Walt Mankowski wrote:
On Tue, Aug 31, 2010 at 12:03:49PM -0400, linc wrote:
DOH!  Yeah, you are right.  Have to use something like:

sed 's/.CEL//' filename > newfile
instead...
That's still not quite right.  You should escape the period and anchor
the end of the string.  This is better:

sed 's/\.CEL$//' filename >newfile
Seems to work fine without that??

Try it on

fooCELbar.CEL

I mean, there's a good change that all the instances of CEL occur at
the ends of the filenames, but why take a chance?

Walt


------------------------------------------------------------------------

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug

HEH!  How about THIS one...:

sed 's/\.CEL//g' filename > newfile
Now I know why I hate sed :)
--
-Linc Fessenden

In the Beginning there was nothing, which exploded - Yeah right...
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug