Part of the Korn script I am writing requires that I replace all occurrences of the ' character with two occurrences ('').  I am trying to log some SQL that I am generating in this script to a column in another table but single quotes need to be replaced with 2 instances of the single quote character.  I know there must be examples of this functionality somewhere but I'm not finding a string replace example specific to variables anywhere.
Replace all occurrences of a character in a variable using korn script
text processing;shell script;ksh;sql
Is there any particular reason you couldn't call sed from within your ksh script?This simple script:#!/bin/kshfoo=left ' rightecho $foofoo=$(echo $foo | sed s#\'#\'\'#g)echo $foogives me this output:left ' rightleft '' right