Hi
I get an Error when i am trying to edit a file thru shell script.
ERROR IS "cat: write error: Bad address."
I don't get this error everytime i run the shell script.
Any idea ??
Here is the piece of code:
echo "Attempting to edit ${ProbeRuleFile}"
if [ -f ${ProbeRuleFile} ]
then
cp ${ProbeRuleFile} ${ProbeRuleFile}.${datestamp}
sleep 5
INSERT13="include \\"\\/opt\\/Omnibus\\/probes\\/solaris2\\/mform_fdf.rules\\"!!\#!\# Here we temporarily
set @Agent, for the above cases"
cat ${ProbeRuleFile} | sed "s/# Here we temporarily.*/${INSERT13}/" | tr '!' '\n' > ${ProbeRuleF
ile}
echo "Setting Events Agent"
sleep 5
INSERT14="case \\"formation\\":! @Agent = \\$agent! case \\"unix\\":"
cat $\{ProbeRuleFile\} | sed "s/case \\"unix\\":.*/$\{INSERT14\}/" | tr '!' '\\n' > $\{ProbeRuleFile\}
TEMP\_LINE_NU=\`grep -n "Details, \\"\\[0-9\\]" $\{ProbeRuleFile\} | awk -F: '\{print $1\}'\`
\(\(TEMP\_LINE_NU = $TEMP\_LINE_NU \+ 1\)\)
echo "line no. ${TEMP_LINE_NU}"
cat ${ProbeRuleFile} | sed "${TEMP_LINE_NU}s/discard/\#discard/" | tr '!' '\n' > ${ProbeRuleFile
}
echo "done \n"
else
echo "File: ${ProbeRuleFile} not found!!!"
#exit
fi