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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

-awk: bailing out near line 1??? 1

Status
Not open for further replies.

Ellinas

Technical User
Feb 8, 2005
6
GB
Hi
I'm using cygwin and the script below works just fine under cygwin..
when i upload it on a unix server the script fails with the following errors
-awk: syntax error near line 1
-awk: bailing out near line 1

any ideas why?
thanx

awk '($2 ~ /*/) {
if ($4 < 40){
print $1,$4,"Failed"
}
else {
print $1,$4
}
}
($2 !~ /*/) {no = $4
if (!no){
print $2,$3,"MISSING"
}
else {
if (no > 40){
print $2,$3,$4
}
else {
print $2,$3,$4,"Failed"
}
}
}' final

final file
=======
96000111 Albert Einstein 86
96000123 Peter Scott 36
96000124 Hilary Smith 80
96000222 Joan Bakewell 50
96000321 Catherine Maguire 43
96000555 * * 36
96000777 * * 46

 
/*/ is an invalid RegExp ...

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
what are you trying to do with this:
($2 ~ /*/)

And what is your FS set to?

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
You may try this instead:
($2 ~ /\*/)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
>You may try this instead:
>($2 ~ /\*/)

>Hope This Helps, PH.


That worked great.Thanks for the tip. i forgot * is a metacharacter.
cheers
Kion
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top