Reputation: 10673
I have a script that I need to reverse engineer, but the script appears to be broken. Below is a segment of the script around where it breaks.
awk 'BEGIN{while ((getline line < "file1") > 0){F=../file2
With similar statements repeated one after the other. The obvious problem is that there's an opening '
and {
, but no closing ones. I could try to fix this, but I don't really know what this is even trying to do. I have some experience with linux commands but not a whole lot.
file2
is a file location, but what is F=
?'
, but why? Should there be a closing one somewhere, or should that not even be there in the first place?Anyone know, or have any ideas, as to what this is supposed to be?
Upvotes: 1
Views: 128
Reputation: 80001
As far as I can tell, this awk line is broken in several ways.
'
, the '
's wrap the command/script you pass to the awk command to run.F=../file1
looks like variable assignment, but it's unquoted so awk thinks you're attempting to write a regular expression, which is unterminated by a second /
.}
.The script looks incomplete since it should break down to this:
# read from file1 until EOF
while ((getline line < "file1") > 0) {
F="../file2"
# what now?
}
Upvotes: 2