How to strip apostrophe from a file

I am trying to remove or replace various extraneous characters from a file so that subsequent processes work correctly. The characters that is giving me trouble is the apostrophe '.

The command I 'm trying is
sed 's/\'//g' ${IN_WRK_DIR}/file1 > ${IN_WRK_DIR}/file2
in a Korn script on HP Unix.

I do need to retain other nonalpha-numeric characters.

Check out this URL...it had helped me sometime back. I came across something similiar.

http://answers.google.com/answers/threadview?id=496910

Vino

Sometimes tr is easier to use than sed for single characters:

cat filename | tr -s "\'" ' '

<UUOC police>
tr -s "\'" ' ' < filename
</UUOC police>

tr works like a charm. As always syntax is everything.

Actually, I don't think so: < opens the file and reads it. So does does cat. tr uses stdin no matter. If it were sed I'd agree.

But in using cat you cat have to make fork and exec system calls for the new process, both are expensive calls, by using < to redirect stdin you do not need to make these calls and so as vergsh99 pointed out it would be a UUOC.

Why do you think it would be any different if it were sed?

sed takes a file as an argument. tr does not.

Yes, but when sed does so it does not spawn or exec a new process to read from the file.

As a general rule any use of cat with a single file is a UUOC.