What is the size of command line
Hello!
I want to install all rpms from folder using command: rpm -i `ls packages` but my friend said that output from ls command can be very long and it can overflow bash buffers. What is the size of bash command line? |
I do believe you are looking for this:
Code:
$ xargs --show-limits |
It's not a bash limit but you can get the E2BIG error from the execve call.
|
In any case, the use of ls here is not only unnecessary, but also wrong. The proper way to run the command is with a simple globbing pattern.
Code:
rpm -i *.rpm Code:
rpmarray=( *.rpm ) I ran a quick test of the above on the entire content of my /etc directory, and it had no problems. Do note though that the above relies on several bash extensions, and won't work properly in a posix-only shell. You'll have to use find and/or xargs if that's necessary. See here for more on shell limits: I'm getting "Argument list too long". How can I process a large list in chunks? http://mywiki.wooledge.org/BashFAQ/095 |
All times are GMT -5. The time now is 02:28 PM. |