I am trying to replace on AIX 6.1 every occurrence of the string "FULL_RUN_SCRIPT_DIR" with a path like "/etc/rc.d/.."
Here is the code
SEE_FILE_PATH="$INIT_DIR$SERVICE_NAME"
FULL_RUN_SCRIPT_DIR="FULL_RUN_SCRIPT_DIR"
SERVICE_FILE="$INIT_DIR$SERVICE_NAME"
echo "String1:$FULL_RUN_SCRIPT_DIR"
echo "String2:$SEE_FILE_PATH"
echo "String3:$SERVICE_FILE"
perl -p -i -e "s/$FULL_RUN_SCRIPT_DIR/$SEE_FILE_PATH/g" "$SERVICE_FILE"
However i get the error :
String1:FULL_RUN_SCRIPT_DIR
String2:/etc/rc.d/init.d/seelinkdeployer
String3:/etc/rc.d/init.d/seelinkdeployer
Bareword found where operator expected at -e line 1, near "s/FULL_RUN_SCRIPT_DIR//etc"
syntax error at -e line 1, near "s/FULL_RUN_SCRIPT_DIR//etc"
Execution of -e aborted due to compilation errors.
Any ideas why?