replacing ' with '' using sed

Hi,
I have a text file and I would like to replace all occurrences of single quote ' with two consecutive single quotes '' .
I have tried

sed s/\'/\'\'/ < Folder/outputFile.txt > Folder/otherFile.txt

but this replaces only the first occurrence of ' with ''. I want it to replace all the single quotes in the entire file with two single quotes.
So 'a' should become ''a'' and so on.
Thanks in advance.

Hi.

Use the global modifier:

sed "s/'/''/g"
MAN SED
g       Make the substitution for all non-overlapping matches of the regular expression, not just
        the first one.
echo "'" |sed 's:'\'':&&:'
''

The octal code for single quote is 047. You can use that instead of \' so it won't appear too messy with the quotes

$ ruby -ne 'puts $_.gsub("\047","\047\047")' file

Thank you very much for the replies. That ( sed "s/'/''/g" ) solved my problem Now I have another problem . I have a file with multi-line text in it. I want the same file to have its entire content surrounded by single quote. So if the file has text

abcdef
pqrst
uvw

I want it to be

'abcdef
 pqrst
 uvw'

How can I achieve this? Thank u in advance.

echo "abcdef
pqrst
uvw" |sed "N;N;s/^.*$/'&'/"
'abcdef
pqrst
uvw'
$ ruby -0777 -ne 'print "\047#{$_}\047"' file
sed q | sed "s/^/'/"   --> for the first line

sed '$!d' | sed "s/^/'/"   --> for the last line