Hi!
I've been trying to use perl -ipe inside a Korn Shell Script top perform substitutions. A sample code is:
...
CRITERIA="'s/$SEARCH_STRING/$REPLACE_STRING/g'"
...
/usr/bin/perl -ipe $CRITERIA $FILE
...
Where:
$SEARCH_STRING is a korn shell var that I've created to
store dynamic search criteria strings.
$REPLACE_STRING is the substitution string.
$FILE is the file where the substitutions will be performed.
===================
PROBLEM:
===================
PERL call is not translating properly shell variables.
I've also tried:
/usr/bin/perl -ipe "$CRITERIA" $FILE
/usr/bin/perl -ipe \$CRITERIA $FILE
And it doesn't work. What's wrong???
I've been trying to use perl -ipe inside a Korn Shell Script top perform substitutions. A sample code is:
...
CRITERIA="'s/$SEARCH_STRING/$REPLACE_STRING/g'"
...
/usr/bin/perl -ipe $CRITERIA $FILE
...
Where:
$SEARCH_STRING is a korn shell var that I've created to
store dynamic search criteria strings.
$REPLACE_STRING is the substitution string.
$FILE is the file where the substitutions will be performed.
===================
PROBLEM:
===================
PERL call is not translating properly shell variables.
I've also tried:
/usr/bin/perl -ipe "$CRITERIA" $FILE
/usr/bin/perl -ipe \$CRITERIA $FILE
And it doesn't work. What's wrong???