Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/usr/bin/Rscript: Argument list too long

Tags:

bash

r

rscript

Using rscript inside a bash script

I am passing the content of text files has arguments. to rscript

"$SCRIPTS/myscript.R" "$filecontent"

I get the following when file have +- over 4000 row

/usr/bin/Rscript: Argument list too long

Any way I can increase the length of accepted argument so I can pass large files?

like image 980
user3641949 Avatar asked Aug 31 '26 07:08

user3641949


1 Answers

What @MrFlick said is correct - you should change the way the arguments are passed to your script. However, if you still want to try to do it your way, then I recommend reading the following article:

"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.

Also, this Unix&Linux thread can help:

“Argument list too long”: How do I deal with it, without changing my command?

like image 170
jimm-cl Avatar answered Sep 02 '26 23:09

jimm-cl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!