Hello,
I'm a newbie to shell scripting and was given the task to work on some scripts that are not working correctly.
The script is doing a find/replace, but it's doing too good of a job, if that is possible.
I want it to change this line:
setenv ORACLE_SID aleph14
But not this one:
setenv ORACLE_ALERT_LOG $ORACLE_BASE/admin/$ORACLE_SID/bdump/alert_${O
RACLE_SID}.log
Any help would be greatly appreciated. Thanks in advance.
Kelly
I'm a newbie to shell scripting and was given the task to work on some scripts that are not working correctly.
The script is doing a find/replace, but it's doing too good of a job, if that is possible.
Code:
VARIABLES="ORA_HOST Z39_HOST [URL unfurl="true"]WWW_HOST[/URL] ORACLE_SID"
#Use sed to search for variable definition and replace with
#user defined variable
for VAR in $VARIABLES
do
VALUE=""
case $VAR in
ORA_HOST) VALUE=$ORA_HOST;;
Z39_HOST) VALUE=$Z39_HOST;;
[URL unfurl="true"]WWW_HOST)[/URL] VALUE=$[URL unfurl="true"]WWW_HOST;;[/URL]
ORACLE_SID) VALUE=$ORACLE_SID;;
esac
$SED 's/^.*setenv.*[^{]'${VAR}'[^}].*/ setenv '${VAR}' '${VALUE}'/
' $ALEPH_START > $ALEPH_START_TEMP
$DIFF $ALEPH_START $ALEPH_START_TEMP >> $LOG
$MV $ALEPH_START_TEMP $ALEPH_START >> $LOG 2>&1
done
echo "-------------------------------------------------------" >> $LOG
setenv ORACLE_SID aleph14
But not this one:
setenv ORACLE_ALERT_LOG $ORACLE_BASE/admin/$ORACLE_SID/bdump/alert_${O
RACLE_SID}.log
Any help would be greatly appreciated. Thanks in advance.
Kelly