r -/usr/bin/Rscript : Argument list too long

标签 r bash rscript

在 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/

相关文章:

r - 在 R/3.0.2 中安装 minqa 时出错

R 和 Rscript 给出不同的日期时间结果

r - 我可以使用 optparse 指定强制参数吗

r - 如何使用控制台输出捕获警告?

r - 我如何以 dcast 之类的方式自行加入 data.table

删除R中的括号

linux - 正则表达式匹配 IP 地址但忽略本地主机

r - 如何找到最长的连续数及其位置?

bash ->>& 在 tcsh 脚本中是什么意思,它如何转换为 bash?

bash - 使用字符串数组作为参数的 Curl POST 请求