Sponsored Content
Top Forums Shell Programming and Scripting Unexpected Argument list too long error on later os level Post 302989227 by stomp on Tuesday 10th of January 2017 06:16:01 AM
Old 01-10-2017
I'd set the limit rather pessimistic. E. g. rather 500 than 2100, because it depends on the length of the parameters when the environment space is used up.

A parameter may be ...
Code:
~/toCopy/short

or it maybe...
Code:
~/toCopy/some_filenames_are_really_long_and_if_you_do_not_know_how_long_the_space_is_eaten_up_with_few_parameters

...and for sure check if it fails nevertheless.

-----

But would it not be better to set the variables so that every command is happy with the limits and will work correctly with it? I do not yet now what variables to adjust so var. But fumbling around to set some limits that hopefully would not be hit seems not to be the cleanest way, despite it'll work 99% if you set the limits very conservative.

-----

the man-page here shows:
Code:
xargs (GNU findutils) 4.4.2

       --max-chars=max-chars
       -s max-chars
              Use at most max-chars characters per command line, including the command and 
              initial-arguments and the terminating nulls at the ends of the argument strings.  
              The largest allowed value is system-dependent, and is calculated as the argument 
              length limit for exec, less the size of your environment, less 2048 bytes of 
              headroom.  If this value  is  more  than 128KiB, 128Kib is used as the default value; 
              otherwise, the default value is the maximum.  1KiB is 1024 bytes.

I would assume that --max-chars is more robust then --max-args

Last edited by stomp; 01-10-2017 at 07:38 AM..
This User Gave Thanks to stomp For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Argument list too long - Shell error

Trying to tar specific files from a directory causes problems when the number of files is too large. ls ~/logs | wc -l 5928 In the logs directory - I have 5928 files If I want to include all files with today's date - I run the following command tar cf ~/archive/LoadLogs_20060302.tar... (8 Replies)
Discussion started by: dad5119
8 Replies

2. Shell Programming and Scripting

TAR Files Argument list too long error

Hi, I have a requirement where I need to TAR more than 50K files. Even though I can do TAR successfully on few 100s of files, but whenever Im trying to TAR the entire 50K files, I am getting the error message : Argument List Too Long. Please suggest how can i avoid this error. Im... (2 Replies)
Discussion started by: unx100
2 Replies

3. Shell Programming and Scripting

"Argument list too long" error

Hi everyone, I have a problem with my shell script. As a quick overview I need to change a template file 6561 times and copy the file into a new catalogue. Thanks to your forum I have managed to write a script to do so: #!/bin/sh template=$1 for values in {45,165,285}\ {45,165,285}\... (6 Replies)
Discussion started by: mario8eren
6 Replies

4. Shell Programming and Scripting

Argument too long list error

I have a wrote a script which consits of the below line.. Below of this script I'm getting this error "ksh: /usr/bin/ls: arg list too long" The line is log_file_time=`ssh -i $HOME/.ssh/id_rsa -q $i ls -lrt /bp/karthik/test/data/log/$abc*|tail -1|awk '{print $8}'` And $abc alias is as "p |... (1 Reply)
Discussion started by: 22karthikreddy
1 Replies

5. Shell Programming and Scripting

Argument list too long problem

I have a huge set of files (with extension .common) in my directory around 2 million. When I run this script on my Linux with BASH, I get /bin/awk: Argument list too long awk -F'\t' ' NR == FNR { a=NR } NR != FNR { sub(".common", "", FILENAME) print a, FILENAME, $1 } '... (1 Reply)
Discussion started by: shoaibjameel123
1 Replies

6. Shell Programming and Scripting

Argument list too long!!

Dear Experts, I have a list of 10K files in a directory. I am not able to execute any commands lile ls -lrt, awk, sed, mv, etc........ I wanna execute below command and get the output. How can I achieve it?? Pls help. root# awk -F'|' '$1 == 1' file_20120710* | wc -l /bin/awk: Argument list... (2 Replies)
Discussion started by: Naga06
2 Replies

7. Shell Programming and Scripting

grep : Argument list too long

Hi, i am having some trouble with the below command, can some one suggest me the better way to do it. grep -l 'ReturnCode=1' `find $Log -newer /tmp/Failed.tmp -print | xargs ls -ld | egrep SUB | egrep -ve 'MTP' -ve 'ABC' -ve 'DEF' -ve 'JKL' -ve 'XYZ' | awk '{print $9}'` > $Home1 Its... (2 Replies)
Discussion started by: Prateek007
2 Replies

8. Shell Programming and Scripting

mv : Argument list too long

Hi I am using find command -- find "directory1" -type f | xargs -i mv {} "directory2" to avoid above argument list too long problem. But, issue i am facing is directory1 is having subdirectories due to this i am facing directory traversal problem as i dont want to traverse subdirectories... (9 Replies)
Discussion started by: VSom007
9 Replies

9. UNIX for Advanced & Expert Users

Argument list too long w/ sed

Hi all, I am using GNU sed (named gsed under macports) in OSX. I have a directory with a series of files named pool_01.jpg through pool_78802.jpg. I am trying to use this command to rename the files to their checksum + extension. md5sum * | gsed -e 's/\(*\) \(.*\(\..*\)\)$/mv -v \2 \1\3/e' ... (3 Replies)
Discussion started by: openthomas
3 Replies

10. Shell Programming and Scripting

Argument list too long

Hi Team, Here's the situation. I have approximately 300000 to 500000 jpg files in /appl/abcd/work_dir mv /appl/abcd/work_dir /appl/abcd/process_dir The above move command will work if the jpg files count is close to 50000 (not sure). If the count is less this mv command holds good. But if... (14 Replies)
Discussion started by: kmanivan82
14 Replies
Net::Sieve(3pm) 					User Contributed Perl Documentation					   Net::Sieve(3pm)

NAME
Net::Sieve - Implementation of managesieve protocol to manage sieve scripts SYNOPSIS
use Net::Sieve; my $SieveServer = Net::Sieve->new ( server => 'imap.server.org', user => 'user', password => 'pass' , ); foreach my $script ( $SieveServer->list() ) { print $script->{name}." ".$script->{status}." "; }; my $name_script = 'test'; # read print $SieveServer->get($name_script); # write my $test_script=' require "fileinto"; ## Place all these in the "Test" folder if header :contains "Subject" "[Test]" { fileinto "Test"; } '; # other $SieveServer->put($name_script,$new_script); $SieveServer->activate($name_script); $SieveServer->deactivate(); $SieveServer->delete($name_script); DESCRIPTION
Net::Sieve is a package for clients for the "MANAGESIEVE" protocol, which is an Internet Draft protocol for manipulation of "Sieve" scripts in a repository. More simply, Net::Sieve lets you control your mail-filtering rule files on a mail server. Net::Sieve supports the use of "TLS" via the "STARTTLS" command. Net::Sieve open the connexion to the sieve server, methods allow to list all scripts, activate or deactivate scripts, read, delete or put scripts. Most of code come from the great Phil Pennock sieve-connect command-line tool <http://people.spodhuis.org/phil.pennock/software/>. See Net::Sieve::Script to manipulate Sieve scripts content. CONSTRUCTOR
new Usage : my $SieveServer = Net::Sieve->new ( server => 'imap.server.org', user => 'user', password => 'pass' ); Returns : Net::Sieve object which contain current open socket Argument : server : default localhost port : default sieve(2000) user : default logname or $ENV{USERNAME} or $ENV{LOGNAME} password : net_domain : sslkeyfile : default search in /etc/ssl/certs sslcertfile : default search in /etc/ssl/certs autmech : to force a particular authentication mechanism authzid : request authorisation to act as the specified id realm : pass realm information to the authentication mechanism ssl_verif : default 0x01, set 0x00 to don't verify and allow self-signed cerificate debug : default 0, set 1 to have transmission logs dumptlsinfo : dump tls information METHODS
sock Usage : my $sock = $ServerSieve->sock(); Return : open socket Argument : nothing Purpose : access to socket capabilities Usage : my $script_capa = $ServerSieve->capabilities(); Return : string with white space separator Argument : nothing Purpose : retrieve sieve script capabilities list Usage : foreach my $script ( $ServerSieve->list() ) { print $script->{name}." ".$script->{status}." "; }; Return : array of hash with names and status scripts for current user Argument : nothing Purpose : list available scripts on server put Usage : $ServerSieve->put($name,$script); Return : 1 on success, 0 on missing name or script Argument : name, script Purpose : put script on server get Usage : my $script = $ServerSieve->get($name); Return : 0 on missing name, string with script on success Argument : name Purpose : put script on server activate Usage : $ServerSieve->activate($name); Return : 0 on pb, 1 on success Argument : name Purpose : set named script active and switch other scripts to unactive deactivate Usage : $ServerSieve->deactivate(); Return : activate response Argument : nothing Purpose : stop sieve processing, deactivate all scripts delete Usage : $ServerSieve->delete($name); Return : 0 on missing name, 1 on success Argument : name Purpose : delete script on server Minor public methods ssend Usage : $self->ssend("GETSCRIPT "$name""); sget Usage: $self->sget(); unless (/^OK((?:s.*)?)$/) { warn "SETACTIVE($name) failed: $_ "; return 0; } sfinish send LOGOUT closedie send LOGOUT and die closedie_NOmsg closedie whitout message die_NOmsg die BUGS
I don't try plain text or client certificate authentication. You can debug TLS connexion with openssl : openssl s_client -connect your.server.org:2000 -tls1 -CApath /etc/apache/ssl.crt/somecrt.crt -starttls smtp See response in "Verify return code:" SUPPORT
Please report any bugs or feature requests to "bug-net-sieve at rt.cpan.org", or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Sieve <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-Sieve>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. AUTHOR
Yves Agostini - Univ Metz <agostini@univ-metz.fr> http://www.crium.univ-metz.fr <http://www.crium.univ-metz.fr> COPYRIGHT
Copyright 2008-2012 Yves Agostini - <yvesago@cpan.org> This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. sieve-connect source code is under a BSD-style license and re-licensed for Net::Sieve with permission of the author. SEE ALSO
Net::Sieve::Script perl v5.14.2 2012-02-22 Net::Sieve(3pm)
All times are GMT -4. The time now is 10:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy