One of my file abc.txt contains below path as one of the line.
/lz/BEN_BOB.success
It is to be replaced as below
/lz/BEN_B.success
I'm generating these names during runtime hence storing in variables as below.
SUCCESS_FILE=/lz/BEN_BOB.success
NEW_SUCCESS_FILE=/lz/BEN_B.success
I'm using below command to replace but not working.
cat abc.txt | sed "s/$SUCCESS_FILE/$NEW_SUCCESS_FILE/g".
Is it because I have / symbol in variables?
As mentioned it is in korn shell.
catecho "SUCCESS_FILE=${SUCCESS_FILE}"? Maybe the runtime generation (in a subshell?) went wrong.