Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

awk -v syntax error

Status
Not open for further replies.

AwkNewbie

Programmer
Nov 12, 2002
4
US
I receive the following error message:

<@begpat=strhelp.ksh>
<@endpat=strhelp.ksh>
awk: syntax error near line 1
awk: bailing out near line 1

Code follows:

any ideas?

#!/usr/bin/ksh

conORACLE_SID=`/usr/ucb/whoami | tr '[:lower:]' '[:upper:]'`

. /opt/clarify/$conORACLE_SID/.profile

strBOOK_MARK=$1
strBEG_MARK=&quot;<@begpat=$1>&quot;
strEND_MARK=&quot;<@endpat=$1>&quot;

echo $strBEG_MARK
echo $strEND_MARK

awk -v aaa=&quot;$strBEG_MARK&quot; -v bbb=&quot;$strEND_MARK&quot; '$0 == aaa, $0 == bbb { if ($0 != aaa && $0 != bbb) print $0 }' strhelp.txt


 
The answer...

awk on soloris 2.6 does not support awk -v... needed to use awk in directory /usr/xpg4/bin and the parameter worked fine...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top