在 bash 脚本中使用 rscript
我传递的文本文件内容有参数。到 rscript
“$SCRIPTS/myscript.R”“$filecontent”
当文件 +- 超过 4000 行时,我得到以下信息
/usr/bin/Rscript:参数列表太长
有什么方法可以增加接受参数的长度,以便我可以传递大文件?
最佳答案
@MrFlick 所说的是正确的 - 您应该更改参数传递给脚本的方式。但是,如果您仍然想尝试按照自己的方式进行操作,那么我建议您阅读以下文章:
"Argument list too long": Beyond Arguments and Limitations
The "Argument list too long" error, which occurs anytime a user feeds too many arguments to a single command, leaves the user to fend for oneself, since all regular system commands (ls *, cp *, rm *, etc...) are subject to the same limitation. This article will focus on identifying four different workaround solutions to this problem, each method using varying degrees of complexity to solve different potential problems.
此外,这个 Unix&Linux 线程可以提供帮助:
“Argument list too long”: How do I deal with it, without changing my command?
关于r -/usr/bin/Rscript : Argument list too long,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24658534/