Computing.Net > Forums > Unix > sed bug?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

sed bug?

Reply to Message Icon

Name: GinoLatino
Date: November 19, 2007 at 11:32:42 Pacific
OS: sun
CPU/Ram: don't know
Product: don't know
Comment:

Hi I have a problem using sed when replacing the string into a file.

I use the following command

sed 's/.000//g' $FILE

it seems to work but it replaces also the occurencies like

000.000

so if I have:

1.000
23.000
4000.000
45.000

I get
1
23

45

so the file content is screwed up!

can anybody help?
thank you,




Sponsored Link
Ads by Google

Response Number 1
Name: lankrypt0
Date: November 19, 2007 at 12:39:22 Pacific
Reply:

I assume you are trying to just strip off the period. The example you gave is correct because in sed . is a wildcard that can mean any character.
The following should work for you:
sed -e 's/\.000//g' $FILE


0
Reply to Message Icon

Related Posts

See More


working with column help with awk



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: sed bug?

Small sed bug - line below www.computing.net/answers/unix/small-sed-bug-line-below/5438.html

sed dropping last line of file www.computing.net/answers/unix/sed-dropping-last-line-of-file/5125.html

SED using special characters www.computing.net/answers/unix/sed-using-special-characters/4804.html