find and replace with variable -sed

Hi,

I have a ksh script where I am trying to mask the password in the log files.

$loc - is my directory
$PGUIDE_DB_USER_PSW - is a variable that holds the password I am looking for


find $loc/logs -type f -exec sed -i "s/$PGUIDE_DB_USER_PSW/*****/"g {} \;

I get an error:

ksh: /*****/g: not found
sed: illegal option -- i

Any ideas?

I am not a expert but i making a guess , the sed version you are using does not have -i option in it. I believe you are using a solaris machine.

try also:

find $loc/logs -type f -exec sed -i 's?$PGUIDE_DB_USER_PSW?*****?g' {} \;