I have this sed working in Linux and have a few AIX servers I need to use it on as well but keep getting this error and I can't find any information on it even though it's specific.
Got the following to work but the complex one I can't figure out.
$RESULTSFILE="RESULTS.txt"
$echo -en "\nLine1 Connection info\n\nLine2\nERROR:\nError message\n\n" > $RESULTSFILE
$result=`sed -n '/^ERROR:/{p}' $RESULTSFILE`
sed: 0602-404 Function /^ERROR:/{p} cannot be parsed.
$if [ "$result" == "ERROR:" ]; then echo True; else echo False; fi
More complex sed
$RESULTSFILE="RESULTS.txt"
$echo -en "\nLine1\n\nLine2\n\nMore lines\n--------------------------------------------------------------------------------\nInfo I want to get\nare each of these\n\nlines.\n\nDisconnected...\n\n" > $RESULTSFILE
$result=`sed -n '/^---*/,/Disconnected/{/^---*/d;/^Disconnect*/d;p}' $RESULTSFILE`
sed: 0602-404 Function /^---*/,/Disconnected/{/^---*/d;/^Disconnect*/d;p} cannot be parsed.