T
tazommers
I have a large ksh script which had an embedded perl invocation to do
a character replace... to fix a date in a large flat file. I know the
script is inefficient, but I wanted to just improve the logic a bit
rather than have to install new scripts etc. Anyway, the file has
records that if start with the character "5" may need to have the date
replaced at position 70 in the file.
Here is the code snipet I have that works, except for one thing...
CMD="perl -p -i -n -e "'"s/^5(.{68})$EFF_DATE/5\$1|$REP_DATE/g"'"
$FILE"
eval $CMD
I don't want that "|" character, but I need something to separate the
$1 for the perl group and the $REP_DATE from the ksh. The $REP_DATE
gets replaced in ksh with the string 080407 for instance, so how does
one separate the $1 group from the string 080407?
a character replace... to fix a date in a large flat file. I know the
script is inefficient, but I wanted to just improve the logic a bit
rather than have to install new scripts etc. Anyway, the file has
records that if start with the character "5" may need to have the date
replaced at position 70 in the file.
Here is the code snipet I have that works, except for one thing...
CMD="perl -p -i -n -e "'"s/^5(.{68})$EFF_DATE/5\$1|$REP_DATE/g"'"
$FILE"
eval $CMD
I don't want that "|" character, but I need something to separate the
$1 for the perl group and the $REP_DATE from the ksh. The $REP_DATE
gets replaced in ksh with the string 080407 for instance, so how does
one separate the $1 group from the string 080407?