/ user / bin / awk:awk中的参数列表太长 [英] /user/bin/awk: Argument list too long in awk

查看:571
本文介绍了/ user / bin / awk:awk中的参数列表太长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能存在重复:

为什么我得到/ bin / sh:参数列表太长当通过引用的参数?


我在shell脚本中使用awk脚本,我正在处理多个文件,每次我从awk获得输出,在shell中处理它,并将处理过的东西反馈回awk脚本。

这里是,每次正在处理的数据都是30000行左右的大数据,我将它们存储在一个变量中,然后使用 -v 选项传递给awk。



所以我收到一个错误


/ usr / bin / awk:参数列表太长


如何解决此问题的任何补救措施。我清除了问题

解决方案

您试图将太多参数传递给 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.)

这篇关于/ user / bin / awk:awk中的参数列表太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆