awk: syntax error near line 1 awk: bailing out near line 1

This is a discussion on awk: syntax error near line 1 awk: bailing out near line 1 within the shell forums in Operating Systems category; hi, i am trying to reflect the name (example: LDRIVE in to RDRIVE) in UNIX sun environment and please find below the script i used. awk -F > '{if (substr($2,2,1) != ) if ((match(substr($2,2,1), [RL] ) != 1) and !((match(substr($2,2,1), [FCA] ) == 1) and (match(substr($2,3,1), [RL] ) == 1))) printf (VNAME 1 %d, %6d ) = %s (unchanged)\n , length(substr($2,2)), NR, substr($2,2); else if (substr($2,2,1) == R ) printf (VNAME 1 %d, %6d ) = L%s (was %s)\n , length(substr($2,2)), NR, substr($2,3), substr($2,2); ...

Go Back   Database Forum > Operating Systems > shell

Database Forums

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-27-2008, 04:02 AM
Default awk: syntax error near line 1 awk: bailing out near line 1

hi,

i am trying to reflect the name (example: LDRIVE in to RDRIVE) in UNIX
sun environment and please find below the script i used.

awk -F ">" '{if (substr($2,2,1) != " ") if ((match(substr($2,2,1),
"[RL]") != 1) and !((match(substr($2,2,1), "[FCA]") == 1) and
(match(substr($2,3,1), "[RL]") == 1))) printf "(VNAME 1 %d, %6d ) =
%s (unchanged)\n", length(substr($2,2)), NR, substr($2,2); else if
(substr($2,2,1) == "R") printf "(VNAME 1 %d, %6d ) = L%s (was %s)\n",
length(substr($2,2)), NR, substr($2,3), substr($2,2); else if
(substr($2,2,1) == "L") printf "(VNAME 1 %d, %6d ) = R%s (was %s)\n",
length(substr($2,2)), NR, substr($2,3), substr($2,2); else if
( match(substr($2,2,1), "[FfCcAa]") == 1 ) if (substr($2,3,1) == "R")
printf "(VNAME 1 %d, %6d ) = %sL%s (was %s)\n", length(substr($2,2)),
NR, substr($2,2,1), substr($2,4), substr($2,2); else if
(substr($2,3,1) == "L") printf "(VNAME 1 %d, %6d ) = %sR%s (was %s)
\n", length(substr($2,2)), NR, substr($2,2,1), substr($2,4),
substr($2,2)}' gridnames


awk -F ">" '{if (substr($2,2,1) != " ") if ((match(substr($2,2,1),
"[RL]") != 1) and !((match(substr($2,2,1), "[FCA]") == 1) and
(match(substr($2,3,1), "[RL]") == 1))) printf "(VNAME 1 %d, %6d ) = %s
\n", length(substr($2,2)), NR, substr($2,2); else if (substr($2,2,1)
== "R") printf "(VNAME 1 %d, %6d ) = L%s\n", length(substr($2,2)), NR,
substr($2,3); else if (substr($2,2,1) == "L") printf "(VNAME 1 %d,
%6d ) = R%s\n", length(substr($2,2)), NR, substr($2,3); else if
( match(substr($2,2,1), "[FfCcAa]") == 1 ) if (substr($2,3,1) == "R")
printf "(VNAME 1 %d, %6d ) = %sL%s\n", length(substr($2,2)), NR,
substr($2,2,1), substr($2,4); else if (substr($2,3,1) == "L") printf
"(VNAME 1 %d, %6d ) = %sR%s\n", length(substr($2,2)), NR,
substr($2,2,1), substr($2,4)}' gridnames >> piok.in2

the following error is coming when i execute:

awk: syntax error near line 1
awk: bailing out near line 1
awk: syntax error near line 1
awk: bailing out near line 1

can any one help in shorting out

thanks

ravi
Reply With Quote
  #2  
Old 08-27-2008, 04:19 AM
Default Re: awk: syntax error near line 1 awk: bailing out near line 1

ramkumar2yk-at-gmail.com wrote:
> hi,
>
> i am trying to reflect the name (example: LDRIVE in to RDRIVE) in UNIX
> sun environment and please find below the script i used.
>
> awk -F ">" '{if (substr($2,2,1) != " ") if ((match(substr($2,2,1),
> "[RL]") != 1) and !((match(substr($2,2,1), "[FCA]") == 1) and
> (match(substr($2,3,1), "[RL]") == 1))) printf "(VNAME 1 %d, %6d ) =
> %s (unchanged)\n", length(substr($2,2)), NR, substr($2,2); else if
> (substr($2,2,1) == "R") printf "(VNAME 1 %d, %6d ) = L%s (was %s)\n",
> length(substr($2,2)), NR, substr($2,3), substr($2,2); else if
> (substr($2,2,1) == "L") printf "(VNAME 1 %d, %6d ) = R%s (was %s)\n",
> length(substr($2,2)), NR, substr($2,3), substr($2,2); else if
> ( match(substr($2,2,1), "[FfCcAa]") == 1 ) if (substr($2,3,1) == "R")
> printf "(VNAME 1 %d, %6d ) = %sL%s (was %s)\n", length(substr($2,2)),
> NR, substr($2,2,1), substr($2,4), substr($2,2); else if
> (substr($2,3,1) == "L") printf "(VNAME 1 %d, %6d ) = %sR%s (was %s)
> \n", length(substr($2,2)), NR, substr($2,2,1), substr($2,4),
> substr($2,2)}' gridnames
>
>
> awk -F ">" '{if (substr($2,2,1) != " ") if ((match(substr($2,2,1),
> "[RL]") != 1) and !((match(substr($2,2,1), "[FCA]") == 1) and
> (match(substr($2,3,1), "[RL]") == 1))) printf "(VNAME 1 %d, %6d ) = %s
> \n", length(substr($2,2)), NR, substr($2,2); else if (substr($2,2,1)
> == "R") printf "(VNAME 1 %d, %6d ) = L%s\n", length(substr($2,2)), NR,
> substr($2,3); else if (substr($2,2,1) == "L") printf "(VNAME 1 %d,
> %6d ) = R%s\n", length(substr($2,2)), NR, substr($2,3); else if
> ( match(substr($2,2,1), "[FfCcAa]") == 1 ) if (substr($2,3,1) == "R")
> printf "(VNAME 1 %d, %6d ) = %sL%s\n", length(substr($2,2)), NR,
> substr($2,2,1), substr($2,4); else if (substr($2,3,1) == "L") printf
> "(VNAME 1 %d, %6d ) = %sR%s\n", length(substr($2,2)), NR,
> substr($2,2,1), substr($2,4)}' gridnames >> piok.in2
>
> the following error is coming when i execute:
>
> awk: syntax error near line 1
> awk: bailing out near line 1
> awk: syntax error near line 1
> awk: bailing out near line 1
>
> can any one help in shorting out


Just a note...

It is possible to put awk programs in a file, say "trash.awk", and
call it as...

awk -f trash.awk datafiles

Then you can also format your code (for free; no extra fee) to become
readable by using a single command per line and proper indentation.
Doing that will greatly increase the number of people who are willing
to analyse your code. Having an awk program of many lines might also
point you to the line number of your problem without necessity to ask
here.

Are you working on solaris? Try /usr/xpg4/bin/awk instead of /bin/awk.

Janis

>
> thanks
>
> ravi

Reply With Quote
  #3  
Old 08-27-2008, 04:41 AM
Default Re: awk: syntax error near line 1 awk: bailing out near line 1

On Wed, 27 Aug 2008 00:02:14 -0700 (PDT), ramkumar2yk-at-gmail.com wrote:

>hi,
>
>i am trying to reflect the name (example: LDRIVE in to RDRIVE) in UNIX
>sun environment and please find below the script i used.
>
>awk -F ">" '{if (substr($2,2,1) != " ") if ((match(substr($2,2,1),
>"[RL]") != 1) and !((match(substr($2,2,1), "[FCA]") == 1) and
>(match(substr($2,3,1), "[RL]") == 1))) printf "(VNAME 1 %d, %6d ) =
>%s (unchanged)\n", length(substr($2,2)), NR, substr($2,2); else if
>(substr($2,2,1) == "R") printf "(VNAME 1 %d, %6d ) = L%s (was %s)\n",
>length(substr($2,2)), NR, substr($2,3), substr($2,2); else if
>(substr($2,2,1) == "L") printf "(VNAME 1 %d, %6d ) = R%s (was %s)\n",


What ever happened to whitespace and structure?

Grant.
--
http://bugsplatter.id.au/
Reply With Quote
  #4  
Old 08-27-2008, 04:34 PM
Default Re: awk: syntax error near line 1 awk: bailing out near line 1

ramkumar2yk-at-gmail.com wrote:
> hi,
>
> i am trying to reflect the name (example: LDRIVE in to RDRIVE) in UNIX
> sun environment and please find below the script i used.
>
> awk -F ">" '{if (substr($2,2,1) != " ") if ((match(substr($2,2,1),
> "[RL]") != 1) and !((match(substr($2,2,1), "[FCA]") == 1) and
> (match(substr($2,3,1), "[RL]") == 1))) printf "(VNAME 1 %d, %6d ) =
> %s (unchanged)\n", length(substr($2,2)), NR, substr($2,2); else if
> (substr($2,2,1) == "R") printf "(VNAME 1 %d, %6d ) = L%s (was %s)\n",
> length(substr($2,2)), NR, substr($2,3), substr($2,2); else if
> (substr($2,2,1) == "L") printf "(VNAME 1 %d, %6d ) = R%s (was %s)\n",
> length(substr($2,2)), NR, substr($2,3), substr($2,2); else if
> ( match(substr($2,2,1), "[FfCcAa]") == 1 ) if (substr($2,3,1) == "R")
> printf "(VNAME 1 %d, %6d ) = %sL%s (was %s)\n", length(substr($2,2)),
> NR, substr($2,2,1), substr($2,4), substr($2,2); else if
> (substr($2,3,1) == "L") printf "(VNAME 1 %d, %6d ) = %sR%s (was %s)
> \n", length(substr($2,2)), NR, substr($2,2,1), substr($2,4),
> substr($2,2)}' gridnames
>
>
> awk -F ">" '{if (substr($2,2,1) != " ") if ((match(substr($2,2,1),
> "[RL]") != 1) and !((match(substr($2,2,1), "[FCA]") == 1) and
> (match(substr($2,3,1), "[RL]") == 1))) printf "(VNAME 1 %d, %6d ) = %s
> \n", length(substr($2,2)), NR, substr($2,2); else if (substr($2,2,1)
> == "R") printf "(VNAME 1 %d, %6d ) = L%s\n", length(substr($2,2)), NR,
> substr($2,3); else if (substr($2,2,1) == "L") printf "(VNAME 1 %d,
> %6d ) = R%s\n", length(substr($2,2)), NR, substr($2,3); else if
> ( match(substr($2,2,1), "[FfCcAa]") == 1 ) if (substr($2,3,1) == "R")
> printf "(VNAME 1 %d, %6d ) = %sL%s\n", length(substr($2,2)), NR,
> substr($2,2,1), substr($2,4); else if (substr($2,3,1) == "L") printf
> "(VNAME 1 %d, %6d ) = %sR%s\n", length(substr($2,2)), NR,
> substr($2,2,1), substr($2,4)}' gridnames >> piok.in2
>
> the following error is coming when i execute:
>
> awk: syntax error near line 1
> awk: bailing out near line 1
> awk: syntax error near line 1
> awk: bailing out near line 1
>
> can any one help in shorting out
>
> thanks
>
> ravi


Try nawk or /usr/xpg4/bin/awk rather than /bin/awk.
At least you'll get a better error message.


--
echo imhcea\.lophc.tcs.hmo |
sed 's2\(....\)\(.\{5\}\)2\2\122;s1\(.\)\(.\)1\2\11g;1 s;\.;::;2'
Reply With Quote
  #5  
Old 08-27-2008, 06:12 PM
Default Re: awk: syntax error near line 1 awk: bailing out near line 1

On Aug 27, 9:34*pm, Michael Tosch
wrote:
> ramkumar...@gmail.com wrote:
> > hi,

>
> > i am trying to reflect the name (example: LDRIVE in to RDRIVE) in UNIX
> > sun environment and please find below the script i used.

>
> > awk -F ">" '{if (substr($2,2,1) != " ") if ((match(substr($2,2,1),
> > "[RL]") != 1) and !((match(substr($2,2,1), "[FCA]") == 1) and
> > (match(substr($2,3,1), "[RL]") == 1))) printf "(VNAME 1 %d, %6d ) =
> > %s *(unchanged)\n", length(substr($2,2)), NR, substr($2,2); else if
> > (substr($2,2,1) == "R") printf "(VNAME 1 %d, %6d ) = L%s *(was %s)\n",
> > length(substr($2,2)), NR, substr($2,3), *substr($2,2); else if
> > (substr($2,2,1) == "L") printf "(VNAME 1 %d, %6d ) = R%s *(was %s)\n",
> > length(substr($2,2)), NR, substr($2,3), substr($2,2); else if
> > ( match(substr($2,2,1), "[FfCcAa]") == 1 ) if (substr($2,3,1) == "R")
> > printf "(VNAME 1 %d, %6d ) = %sL%s *(was %s)\n", length(substr($2,2)),
> > NR, substr($2,2,1), substr($2,4), *substr($2,2); else if
> > (substr($2,3,1) == "L") printf "(VNAME 1 %d, %6d ) = %sR%s *(was %s)
> > \n", length(substr($2,2)), NR, substr($2,2,1), substr($2,4),
> > substr($2,2)}' gridnames

>
> > awk -F ">" '{if (substr($2,2,1) != " ") if ((match(substr($2,2,1),
> > "[RL]") != 1) and !((match(substr($2,2,1), "[FCA]") == 1) and
> > (match(substr($2,3,1), "[RL]") == 1))) printf "(VNAME 1 %d, %6d ) = %s
> > \n", length(substr($2,2)), NR, substr($2,2); else if (substr($2,2,1)
> > == "R") printf "(VNAME 1 %d, %6d ) = L%s\n", length(substr($2,2)), NR,
> > substr($2,3); else if (substr($2,2,1) == "L") printf "(VNAME 1 %d,
> > %6d ) = R%s\n", length(substr($2,2)), NR, substr($2,3); else if
> > ( match(substr($2,2,1), "[FfCcAa]") == 1 ) if (substr($2,3,1) == "R")
> > printf "(VNAME 1 %d, %6d ) = %sL%s\n", length(substr($2,2)), NR,
> > substr($2,2,1), substr($2,4); else if (substr($2,3,1) == "L") printf
> > "(VNAME 1 %d, %6d ) = %sR%s\n", length(substr($2,2)), NR,
> > substr($2,2,1), substr($2,4)}' gridnames >> piok.in2

>
> > the following error is coming when i execute:

>
> > awk: syntax error near line 1
> > awk: bailing out near line 1
> > awk: syntax error near line 1
> > awk: bailing out near line 1

>
> > can any one help in shorting out

>
> > thanks

>
> > ravi

>
> Try nawk or /usr/xpg4/bin/awk rather than /bin/awk.
> At least you'll get a better error message.
>
> --
> echo imhcea\.lophc.tcs.hmo |
> sed 's2\(....\)\(.\{5\}\)2\2\122;s1\(.\)\(.\)1\2\11g;1 s;\.;::;2'- Hide quoted text -
>
> - Show quoted text -


Hi,

In addition to Janis'recommendations, you'd gain in readability if you
were storing function results into intermediary variables.

Anyway, I think the errors arise from the fact that "and" is not the
right logical conjunction operator. You'd rather use "&&".

Hope it helps.

Cheers,

Jean-Philippe
Reply With Quote
  #6  
Old 08-28-2008, 02:35 AM
Default Re: awk: syntax error near line 1 awk: bailing out near line 1

On Aug 27, 7:19 am, Janis Papanagnou
wrote:
> ramkumar...@gmail.com wrote:
> > hi,

>
> > i am trying to reflect the name (example: LDRIVE in to RDRIVE) in UNIX
> > sun environment and please find below the script i used.

>
> > awk -F ">" '{if (substr($2,2,1) != " ") if ((match(substr($2,2,1),
> > "[RL]") != 1) and !((match(substr($2,2,1), "[FCA]") == 1) and
> > (match(substr($2,3,1), "[RL]") == 1))) printf "(VNAME 1 %d, %6d ) =
> > %s (unchanged)\n", length(substr($2,2)), NR, substr($2,2); else if
> > (substr($2,2,1) == "R") printf "(VNAME 1 %d, %6d ) = L%s (was %s)\n",
> > length(substr($2,2)), NR, substr($2,3), substr($2,2); else if
> > (substr($2,2,1) == "L") printf "(VNAME 1 %d, %6d ) = R%s (was %s)\n",
> > length(substr($2,2)), NR, substr($2,3), substr($2,2); else if
> > ( match(substr($2,2,1), "[FfCcAa]") == 1 ) if (substr($2,3,1) == "R")
> > printf "(VNAME 1 %d, %6d ) = %sL%s (was %s)\n", length(substr($2,2)),
> > NR, substr($2,2,1), substr($2,4), substr($2,2); else if
> > (substr($2,3,1) == "L") printf "(VNAME 1 %d, %6d ) = %sR%s (was %s)
> > \n", length(substr($2,2)), NR, substr($2,2,1), substr($2,4),
> > substr($2,2)}' gridnames

>
> > awk -F ">" '{if (substr($2,2,1) != " ") if ((match(substr($2,2,1),
> > "[RL]") != 1) and !((match(substr($2,2,1), "[FCA]") == 1) and
> > (match(substr($2,3,1), "[RL]") == 1))) printf "(VNAME 1 %d, %6d ) = %s
> > \n", length(substr($2,2)), NR, substr($2,2); else if (substr($2,2,1)
> > == "R") printf "(VNAME 1 %d, %6d ) = L%s\n", length(substr($2,2)), NR,
> > substr($2,3); else if (substr($2,2,1) == "L") printf "(VNAME 1 %d,
> > %6d ) = R%s\n", length(substr($2,2)), NR, substr($2,3); else if
> > ( match(substr($2,2,1), "[FfCcAa]") == 1 ) if (substr($2,3,1) == "R")
> > printf "(VNAME 1 %d, %6d ) = %sL%s\n", length(substr($2,2)), NR,
> > substr($2,2,1), substr($2,4); else if (substr($2,3,1) == "L") printf
> > "(VNAME 1 %d, %6d ) = %sR%s\n", length(substr($2,2)), NR,
> > substr($2,2,1), substr($2,4)}' gridnames >> piok.in2

>
> > the following error is coming when i execute:

>
> > awk: syntax error near line 1
> > awk: bailing out near line 1
> > awk: syntax error near line 1
> > awk: bailing out near line 1

>
> > can any one help in shorting out

>
> Just a note...
>
> It is possible to put awk programs in a file, say "trash.awk", and
> call it as...
>
> awk -f trash.awk datafiles
>
> Then you can also format your code (for free; no extra fee) to become
> readable by using a single command per line and proper indentation.
> Doing that will greatly increase the number of people who are willing
> to analyse your code. Having an awk program of many lines might also
> point you to the line number of your problem without necessity to ask
> here.
>
> Are you working on solaris? Try /usr/xpg4/bin/awk instead of /bin/awk.
>
> Janis
>
>
>
> > thanks

>
> > ravi



Greetings and thanks for your effort.

when i execute the above script in hp workstation it is working fine
but in the sun machine it is not working. can you guide me to short
out from the below error:

awk: syntax error near line 1
awk: bailing out near line 1
awk: syntax error near line 1
awk: bailing out near line 1

thanks

ravi
Reply With Quote
  #7  
Old 08-28-2008, 03:25 AM
Default Re: awk: syntax error near line 1 awk: bailing out near line 1

ramkumar2yk-at-gmail.com wrote:
> On Aug 27, 7:19 am, Janis Papanagnou
> wrote:
>
>>ramkumar...@gmail.com wrote:
>>
>>>hi,

>>
>>>i am trying to reflect the name (example: LDRIVE in to RDRIVE) in UNIX
>>>sun environment and please find below the script i used.

>>
>>>awk -F ">" '{if (substr($2,2,1) != " ") if ((match(substr($2,2,1),
>>>"[RL]") != 1) and !((match(substr($2,2,1), "[FCA]") == 1) and
>>>(match(substr($2,3,1), "[RL]") == 1))) printf "(VNAME 1 %d, %6d ) =
>>>%s (unchanged)\n", length(substr($2,2)), NR, substr($2,2); else if
>>>(substr($2,2,1) == "R") printf "(VNAME 1 %d, %6d ) = L%s (was %s)\n",
>>>length(substr($2,2)), NR, substr($2,3), substr($2,2); else if
>>>(substr($2,2,1) == "L") printf "(VNAME 1 %d, %6d ) = R%s (was %s)\n",
>>>length(substr($2,2)), NR, substr($2,3), substr($2,2); else if
>>>( match(substr($2,2,1), "[FfCcAa]") == 1 ) if (substr($2,3,1) == "R")
>>>printf "(VNAME 1 %d, %6d ) = %sL%s (was %s)\n", length(substr($2,2)),
>>>NR, substr($2,2,1), substr($2,4), substr($2,2); else if
>>>(substr($2,3,1) == "L") printf "(VNAME 1 %d, %6d ) = %sR%s (was %s)
>>>\n", length(substr($2,2)), NR, substr($2,2,1), substr($2,4),
>>>substr($2,2)}' gridnames

>>
>>>awk -F ">" '{if (substr($2,2,1) != " ") if ((match(substr($2,2,1),
>>>"[RL]") != 1) and !((match(substr($2,2,1), "[FCA]") == 1) and
>>>(match(substr($2,3,1), "[RL]") == 1))) printf "(VNAME 1 %d, %6d ) = %s
>>>\n", length(substr($2,2)), NR, substr($2,2); else if (substr($2,2,1)
>>>== "R") printf "(VNAME 1 %d, %6d ) = L%s\n", length(substr($2,2)), NR,
>>>substr($2,3); else if (substr($2,2,1) == "L") printf "(VNAME 1 %d,
>>>%6d ) = R%s\n", length(substr($2,2)), NR, substr($2,3); else if
>>>( match(substr($2,2,1), "[FfCcAa]") == 1 ) if (substr($2,3,1) == "R")
>>>printf "(VNAME 1 %d, %6d ) = %sL%s\n", length(substr($2,2)), NR,
>>>substr($2,2,1), substr($2,4); else if (substr($2,3,1) == "L") printf
>>>"(VNAME 1 %d, %6d ) = %sR%s\n", length(substr($2,2)), NR,
>>>substr($2,2,1), substr($2,4)}' gridnames >> piok.in2

>>
>>>the following error is coming when i execute:

>>
>>>awk: syntax error near line 1
>>>awk: bailing out near line 1
>>>awk: syntax error near line 1
>>>awk: bailing out near line 1

>>
>>>can any one help in shorting out

>>
>>Just a note...
>>
>>It is possible to put awk programs in a file, say "trash.awk", and
>>call it as...
>>
>> awk -f trash.awk datafiles
>>
>>Then you can also format your code (for free; no extra fee) to become
>>readable by using a single command per line and proper indentation.
>>Doing that will greatly increase the number of people who are willing
>>to analyse your code. Having an awk program of many lines might also
>>point you to the line number of your problem without necessity to ask
>>here.
>>
>>Are you working on solaris? Try /usr/xpg4/bin/awk instead of /bin/awk.
>>
>>Janis
>>
>>
>>
>>
>>>thanks

>>
>>>ravi

>
>
>
> Greetings and thanks for your effort.
>
> when i execute the above script in hp workstation it is working fine
> but in the sun machine it is not working. can you guide me to short
> out from the below error:


As said, instead of...

awk -F ">" '...'

try

/usr/xpg4/bin/awk -F ">" '...'

or reformat your code to make it legible for an analysis.

Janis

>
> awk: syntax error near line 1
> awk: bailing out near line 1
> awk: syntax error near line 1
> awk: bailing out near line 1
>
> thanks
>
> ravi

Reply With Quote
  #8  
Old 09-01-2008, 09:07 PM
Default Re: awk: syntax error near line 1 awk: bailing out near line 1

ramkumar2yk-at-gmail.com writes:

> Greetings and thanks for your effort.
>
> when i execute the above script in hp workstation it is working fine
> but in the sun machine it is not working. can you guide me to short
> out from the below error:
>
> awk: syntax error near line 1
> awk: bailing out near line 1
> awk: syntax error near line 1
> awk: bailing out near line 1


Don't use awk. Use nawk. This is new awk.
Both ar on the SOlaris OS.
There are many many reasons to use the new awk.
Reason #1 - better error messages.



Reply With Quote
  #9  
Old 09-02-2008, 09:31 AM
Default Re: awk: syntax error near line 1 awk: bailing out near line 1

On 9/1/2008 7:07 PM, Maxwell Lol wrote:
> ramkumar2yk-at-gmail.com writes:
>
>
>>Greetings and thanks for your effort.
>>
>>when i execute the above script in hp workstation it is working fine
>>but in the sun machine it is not working. can you guide me to short
>>out from the below error:
>>
>>awk: syntax error near line 1
>>awk: bailing out near line 1
>>awk: syntax error near line 1
>>awk: bailing out near line 1

>
>
> Don't use awk. Use nawk. This is new awk.


Or /usr/xpg4/bin/awk. Just don't use old, broken awk.

> Both ar on the SOlaris OS.
> There are many many reasons to use the new awk.
> Reason #1 - better error messages.


Reason #1 - fewer error messages ;-).

Ed.


Reply With Quote
  #10  
Old 09-02-2008, 10:16 AM
Default Re: awk: syntax error near line 1 awk: bailing out near line 1

In article <48BD3213.9030908@lsupcaemnt.com>,
Ed Morton wrote:
>On 9/1/2008 7:07 PM, Maxwell Lol wrote:
>> ramkumar2yk-at-gmail.com writes:
>>
>>
>>>Greetings and thanks for your effort.
>>>
>>>when i execute the above script in hp workstation it is working fine
>>>but in the sun machine it is not working. can you guide me to short
>>>out from the below error:
>>>
>>>awk: syntax error near line 1
>>>awk: bailing out near line 1
>>>awk: syntax error near line 1
>>>awk: bailing out near line 1

>>
>>
>> Don't use awk. Use nawk. This is new awk.

>
>Or /usr/xpg4/bin/awk. Just don't use old, broken awk.


Why do people give this crappy advice? Both nawk and xpg4awk are just
somewhat better (read: not terrible) than Solaris:binawk.

If you're going to go non-standard (don't bother to argue with this; you
know what I mean), just get GAWK and be happy.

>> Both ar on the SOlaris OS.
>> There are many many reasons to use the new awk.
>> Reason #1 - better error messages.

>
>Reason #1 - fewer error messages ;-).
>
> Ed.


Yes. That should be:

Reason #1 - fewer error messages
Reason #2 - better error messages

Reply With Quote
Reply


Thread Tools
Display Modes



All times are GMT -4. The time now is 09:50 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Integrated by bbpixel2008 :: jvbPlugin R1013.368.1

Search Engine Friendly URLs by vBSEO 3.1.0
vB Ad Management by =RedTyger=
In an effort to better serve ads to our visitors, cookies are used on Mydatabasesupport.com. For more information, check out our Privacy Policy.