这个 awk 脚本有什么作用?
我有一个脚本需要进行逆向工程,但该脚本似乎已损坏。下面是脚本中中断的部分。
awk 'BEGIN{while ((getline line < "file1") > 0){F=../file2
类似的言论一一重复。明显的问题是有一个开始的 '
和 {
,但没有结束的。我可以尝试解决这个问题,但我真的不知道这到底想做什么。我对 Linux 命令有一些经验,但不是很多。
- 我知道
file2
是一个文件位置,但是F=
是什么? - 开头是
'
,但是为什么呢?是否应该在某个地方有一个结束语,或者根本就不应该存在?
有人知道,或者有任何想法,这应该是什么?
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.
- I understand that
file2
is a file location, but what isF=
? - There's the beginning
'
, 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,这条 awk 行有几个方面被破坏了。
'
,'
包装您传递给 awk 命令运行的命令/脚本。F=../file1
看起来像变量赋值,但它没有加引号,因此 awk 认为您正在尝试编写一个正则表达式,该正则表达式未被第二个/
终止。}
。该脚本看起来不完整,因为它应该分解为:
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: