Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setenv error 1

Status
Not open for further replies.

dbadmin

Programmer
Jan 3, 2003
147
0
0
US
Hi,

Hi,

I am trying to set a long string as environment variable and getting this error, too many arguments. I am putting back slash for the new line escape. Any help is really appreciated.

setenv PATH .:/opt/vendor/software/bin:/usr/ccs/bin:\
/usr/openwin/bin:/tmp:/opt/perl/bin:/opt/patch/Oct2009:$PATH

Thanks,
dbadmin
 
Have you tried this ?
setenv PATH ".:/opt/vendor/software/bin:/usr/ccs/bin:/usr/openwin/bin:/tmp:/opt/perl/bin:/opt/patch/Oct2009:$PATH"

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi PHV,

Thanks for the quick reply. My specific question was how could I have the setenv comand spans multi line? If the same command is one line, it executes successfully. Actually my original setenv command is longer that the one I posted. SO I need the "\" escape character and that creates problem.

dbadmin
 
SO I need the "\" escape character
Why ?
Anyway for me setenv is a ?csh command and thus I can't help, sorry.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Hi,

Are you really asking for a way to have the setenv command span multiple lines? The solution PHV provided should work as below.

setenv PATH ".:/opt/vendor/software/bin:/usr/ccs/bin:\
/usr/openwin/bin:/tmp:/opt/perl/bin:/opt/patch/Oct2009:$PATH"
Thanks,
njoydb
 
Although long-winded and involving unnecessary typing, it is possible to use a construct like the following, to build up the PATH variable 'bit by bit':
setenv PATH .:/opt/vendor/software/bin:$PATH
setenv PATH /usr/ccs/bin:/usr/openwin/bin:$PATH
setenv PATH /tmp:/opt/perl/bin:$PATH
setenv PATH /opt/patch/Oct2009:$PATH

But the main reason for posting is to point out the danger of having "/tmp" in your PATH. Everyone has permission to write to /tmp, so anyone could put a script or command in there with the same name as something in a directory further down the PATH and have it run instead of (or before) the intended script or command. A real potential for a security breach.


I hope that helps.

Mike
 
Good catch on the /tmp thing, Mike. . is equally risky to have in your PATH, but many like to do it for convenience.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top