Max number of environment variables in Csh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Max number of environment variables in Csh
# 1  
Old 01-03-2011
Max number of environment variables in Csh

Anyone knows what is the max limit of number of environment variables in Csh? I have a script that when run causes the shell to stop responding to any command like:

Code:
ls
/bin/ls: Argument list too long.

And I guess the reason is I passed the max limit for number of environment variables defined through the script run. Thanks in advance for help.
# 2  
Old 01-03-2011
your shell forks a subshell and this subshell invokes execve(/bin/ls,argv...,envp...) and your args have to within ARG_MAX range..
Code:
getconf  ARG_MAX
131072

if your arguments wants the larger buffer than ARG_MAX then ls fails..
and generate this error message..
its define in `/usr/src/kernels/2.6....../include/asm-generic/errno-base.h` and execve uses this
Code:
#define E2BIG            7      /* Argument list too long */

you maybe can try xargs to pratical or split the files in proper directorys
Code:
find /home/cshuser/ -print0| xargs ls -l

regards
ygemici

Last edited by ygemici; 03-24-2011 at 11:09 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Issue nesting variables in csh.

The variables given are already defined ($file1-$file3, $obsid1-$obsid3, and $n=3). When I go to run the code, the terminal outputs "Missing }." I believe the error is with the nesting of variables. It would save a lot of time getting this while loop working. set i = 1 while (${i} <=... (5 Replies)
Discussion started by: ojdefdidit
5 Replies

2. Homework & Coursework Questions

Environment Variables

1. The problem statement: What is the mesg value set for your environment? If it is on, how would you turn off your current session? How would you set it permanently? 3. The attempts at a solution : Read Unix The textbook. 3rd chapter has many things like environment variables and... (5 Replies)
Discussion started by: mahinkhan22
5 Replies

3. Shell Programming and Scripting

How to use ifdef for bash variables in csh environment?

Hi Guys, I have a a bash script and i am exporting a variable in it. I am calling a csh script from this bash script. The variable "ABC" will be visible in csh script. ks.bash export ABC = abc ./kp.csh ab.csh echo $ABC setenv ABC =cde (i want to assign this value to ABC only if... (4 Replies)
Discussion started by: vdhingra123
4 Replies

4. Shell Programming and Scripting

How to access the bash variables in csh

Hi, I am having a primary script which is Bash based. I am calling a csh script from it. Now, their are some variables defined in my bash script which i need in csh. I am unable to do so. Is it possible ? (2 Replies)
Discussion started by: vdhingra123
2 Replies

5. Shell Programming and Scripting

How to run csh environment parameters from k-shell script?

Hi Guys, I need to run an alias from a k-shell script ,for example 10204, which points to : source $ORACLE_BASE/scripts/cshrc/10204/.cshrc Meaning , I need to run in my k-shell script with the env settings parameters of the alias. How to do it in k-shell? Thanks in advance, Nir (2 Replies)
Discussion started by: nir_s
2 Replies

6. Shell Programming and Scripting

Perl Csh - setenv ENV change environment variable

I have 3 programs, 1 in perl, 2 in csh: call them perl1, csh1 and run.ol I need perl1 to set csh1 variable NOLOG_qsub = "" I need perl1 to run, run.ol run.ol takes the executable and input and outputs to output run.ol#!/bin/csh -f # run.ol executable input output perl1 should... (1 Reply)
Discussion started by: austinj
1 Replies

7. Shell Programming and Scripting

Max number of variables?

Hi Folks.Just out of interest does anyone know if their is a maximum number of variables that korn shell supports and if so how do I query what it is?Cheers (1 Reply)
Discussion started by: steadyonabix
1 Replies

8. Shell Programming and Scripting

find max number

Hi, i have a file with numbers in it and i was wondering if there's a script i could use to find the max number and have that printed to a new file? example a.txt 18 26 47 34 27 so find the max number in a.txt and print it to b.txt. Thanks! (17 Replies)
Discussion started by: moonbaby
17 Replies

9. Solaris

Max. Possible number of IOs

Hi, Is there a way to find out the maximum possible number of IOs on a Solaris Servers. I'm using SUN Fire V240 (2 Replies)
Discussion started by: justsam
2 Replies

10. Shell Programming and Scripting

How to pass CSH variables up to the parent?

Hi .. I have a dynamic script called from a programming language called Powerhouse (4GL). The module, called QUIZ, allows the user to call shell commands from within it... i.e. !rm -f mipss156t2cmd1.bat mipss156t2tmp1.txt !printf '#!/bin/csh\n' > mipss156t2cmd1.bat !printf 'setenv... (0 Replies)
Discussion started by: ElCaito
0 Replies
Login or Register to Ask a Question