且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

/ user / bin / awk:awk中的参数列表太长

更新时间:2023-12-04 19:56:58

您试图将太多参数传递给 awk

code>。您不应该使用 -v 传递任意大量的数据;取而代之的是通过管道输入 awk 的标准输入。

(我无法向您展示示例代码没有看到你的代码片段,因为我不完全理解你当前如何处理你的数据。)


Possible Duplicate:
Why do I get “/bin/sh: Argument list too long” when passing quoted arguments?

I am using awk script inside a shell script and I am processing multiple files and for everytime I am getting the output from awk, processing it in shell and the feeding back the processd thing into awk script again.

But the problem here is, each time the data that is being processed is huge around 30000 lines which I am storing it in a single variable and I am passing into awk using the -v option.

So I am getting an error

/usr/bin/awk: Argument list too long

Any remedy of how to solve this .. And am I clear with the question

You're trying to pass too many arguments to awk. You shouldn't use -v to pass arbitrarily large amounts of data; feed it via a pipe to awk's standard input instead.

(I can't show you example code without seeing a snippet of your code, since I don't fully understand how you're currently handling your data.)