Operating System - HP-UX
1748249 Members
3724 Online
108760 Solutions
New Discussion юеВ

[help]setenv: Too many arguments.[help]

 
SOLVED
Go to solution
zhangr_2
Advisor

[help]setenv: Too many arguments.[help]

Hi,
I've got a problem recently.
I've two big applications ,both of them are needed to set a lot of parameters in the csh enviroment .and of course I also have some personal parameter need to be set.
but after I add all the lines(like below) to a env.cshrc
setenv PARAMATER1 XXXXXX
...
and run the command
source /PATH/TO/env.cshrc
I got a error message:

setenv: Too many arguments.

and as it said.
some parameters no set as well.
I'm just wondering ,is there a limition of the numbers of csh's parameter?
how can I fix this problem?if later I have more applications and need more parameters needed to be set,what can I do?
thanks

Br Rzhang
5 REPLIES 5
Bharat Katkar
Honored Contributor

Re: [help]setenv: Too many arguments.[help]

What i undestand is your are giving too many arguments to setenv command.
Just go back and check by mistake if your syntax i.e. setenv PARAMATER1 XXXXXX is consistent allover.
What you have given is correct but somewhere it might have gone wrong.


You need to know a lot to actually know how little you know
zhangr_2
Advisor

Re: [help]setenv: Too many arguments.[help]

actually,I have 3 *.cshrc file there are :
app1.cshrc / app2.cshrc / personal.cshrc
before I add "source app2.cshrc" to ~/.cshrc ,I only "source app1.cshrc;source personal.cshrc" in my ~/.cshrc
I can source ~/.cshrc successfully , when the ~/.cshrc only have 2 *.cshrc file i.e.(app1.cshrc + personal.cshrc) or (app2.cshrc + personal.cshrc)
but failed when the ~/.cshrc have all the three *.cshrc (app1.cshrc + app2.cshrc + personal.cshrc)
Victor Fridyev
Honored Contributor
Solution

Re: [help]setenv: Too many arguments.[help]

Hi,

May be some of the parameters have a space. Could you use setenv in the following form ?
setenv PARAMETER "VALUE"
Use double quots, this may prevent such errors.

HTH
Entities are not to be multiplied beyond necessity - RTFM
Jeroen Peereboom
Honored Contributor

Re: [help]setenv: Too many arguments.[help]

Probably there is an error in app2.cshrc.

I would use a 'binary search' to find the offending line: comment out half of the lines and see if the error is in the remaining lines or in the lines commented out. Next, refine you search.

I too believe you have a space somewhere in an parameter assignment.

Maybe the cshell has a verbose mode like the posix shells ('set -xv')?

JP.
zhangr_2
Advisor

Re: [help]setenv: Too many arguments.[help]

Jeroen Peereboom / Victor Fridyev are right.actually the problem is caused by syntax problem. 8-)
sorry for my careless! 8-)