book graphic unix and linux troubleshooting guide

My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!







This article is from a FAQ concerning SCO operating systems. While some of the information may be applicable to any OS, or any Unix or Linux OS, it may be specific to SCO Xenix, Open Desktop or Openserver.

There is lots of Linux, Mac OS X and general Unix info elsewhere on this site: Search this site is the best way to find anything.

Unix, Xenix and ODT General FAQ

How do I solve an "arglist too long"?

Wildcard expansion (globbing) is performed by the shell. There is a limit of 5120 bytes (5k) for the environment and command line arguments put together, in all versions of SCO Xenix and SCO Unix versions prior to OpenServer 5; more on OSR5 later. See also TA 480563.


Hate these ads?

This is particularly likely to be a problem under X, as it has a habit of using a lot of environment space. It is also a problem when running a command such as ls *.c in a directory with a large number of files which match the filespec.

The general solution is to construct your command in such a way that it does not have to include all of the filenames on the command line. You can use the echo command, which is built into the shells and therefore is not subject to the 5k limit. For example, rather than rm V*, you might try echo V* | xargs rm. A similar, but somewhat more complex solution, might involve using the ls command to generate a list of filenames, and then using a command such as grep to filter them; ls | grep '^V' | xargs rm will perform the same task as the above example.

You may also find the find command to be useful in this; however, it works recursively so it may not be appropriate in a directory with subdirectories. Please consult the man pages for each of these commands to identify any unexpected side effects they may cause.

Another alternative, in cases where the environment is unnecessarily large, is to reduce its size. If you have some environment variables that you never use (be careful with this, as the system or some commands may use things you don't realize), you can permanently remove them in your .profile (or .login for C Shell users). You could also temporarily remove some manually. To run a subshell without any of the environment being passed to it, try running env - sh -c 'command'

OpenServer Release 5 makes two changes to cure this problem. The default limit has been increased substantially (to 100k), which should by itself fix almost all instances of "arglist too long". As well, it is now a tunable kernel parameter, ( http://aplawrence.com/cgi-bin/ta.pl?105076 MAXEXECARGS) so if the default isn't adequate, you can adjust it. One exception: /bin/csh still has a hard-coded limit to the length of a line. If you are using csh, you may wish to replace it with tcsh (discussed below).





ad

Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

Or use any RSS reader

Delivered by FeedBurner


ad

Views for this page
Today This Week This Month This Year  Overall
6314646 4,027

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

pavatar.jpg
More:




Related Posts

Grep awk example`

Xargs test question

Wrapping scripts

grep and ps

Grep -d --recurse

Xargs test question

How do I recursively grep through sub directories?

Grep in Depth

Xargs


Unix/Linux Consultants


http://www.breakthru.com.au SCO (Openserver and Unixware), Unix, Solaris and Linux Consulting services including: Secure Networking Solutions; Linux based Firewalls; Backup Solutions; Secure Home to Office Network Setup; Phone, Remote and On-Site Support available - Satisfaction Guaranteed!


SCO, OpenServer, UnixWare, software, servers, security, networks, installation, administration, troubleshooting, maintenance, Watchguard, firewalls, VPNs, e-mail. Visit us at Open Systems Computing and www.go2unix.com.


http://bcstechnology.net Full service Linux & UNIX systems integrator; Windows to UNIX/Linux Client-Server Specialist; Secure E-Mail & Website Hosting; Thoroughbred Software Developer; Custom Industrial Automation; Hardware & Electronics Experts; In Business Since 1985.



Twitter
o If I'd known I could buy a Massachusetts Senator for a lousy $23 grand, I would have bought one long ago. 7:01 AM Oct 31st 2008








Change Congress