LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-03-2009, 01:33 PM   #1
meetmefar
LQ Newbie
 
Registered: Aug 2005
Distribution: Linspire
Posts: 22

Rep: Reputation: 0
setting environment variable error


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,
meetmefar
 
Old 12-03-2009, 01:36 PM   #2
Hendronicus
Member
 
Registered: Feb 2006
Location: Oldsmar, Fl. USA
Distribution: Slackware, Ubuntu
Posts: 176

Rep: Reputation: 50
The $PATH setting at the end causes the line to recursively reproduce until you run out of environment space.
 
Old 12-03-2009, 01:42 PM   #3
opadeboer
LQ Newbie
 
Registered: Nov 2009
Location: The Netherlands
Distribution: ? wath is that?
Posts: 3

Rep: Reputation: 0
EasyNote Mz35-V-080 (Packardbell) doesnot start with Ubuntu 9.10, kernel 2.6.31-14-generic. The kernel is waiting for an interrupt from the disk. Thanks to the Startup monitor. I use kernel 2.6.28-16-generic insteed.
 
Old 12-03-2009, 01:46 PM   #4
Hendronicus
Member
 
Registered: Feb 2006
Location: Oldsmar, Fl. USA
Distribution: Slackware, Ubuntu
Posts: 176

Rep: Reputation: 50
Quote:
Originally Posted by opadeboer View Post
EasyNote Mz35-V-080 (Packardbell) doesnot start with Ubuntu 9.10, kernel 2.6.31-14-generic. The kernel is waiting for an interrupt from the disk. Thanks to the Startup monitor. I use kernel 2.6.28-16-generic insteed.
What are you talking about? I think you posted to the wrong thread. It happens, sometimes.
 
Old 12-03-2009, 01:47 PM   #5
opadeboer
LQ Newbie
 
Registered: Nov 2009
Location: The Netherlands
Distribution: ? wath is that?
Posts: 3

Rep: Reputation: 0
Red face Ubuntu 9.10 kernel 2.6.31-14 and EasyNote MZ35-V-080

The startup process is in a loop waiting for an interrupt of the disk.
I tried Ubuntu 9.10 kernel 2.6.28-16 and this one did not have that problem. PC is: Packardbell EasyNote MZ35-V-080
 
Old 12-03-2009, 01:55 PM   #6
Hendronicus
Member
 
Registered: Feb 2006
Location: Oldsmar, Fl. USA
Distribution: Slackware, Ubuntu
Posts: 176

Rep: Reputation: 50
Wink

Quote:
Originally Posted by opadeboer View Post
The startup process is in a loop waiting for an interrupt of the disk.
I tried Ubuntu 9.10 kernel 2.6.28-16 and this one did not have that problem. PC is: Packardbell EasyNote MZ35-V-080
Alright, but this isn't that thread. This thread is about meetmefar having an error setting his environment. That's not the same thing. As for your problem, I'm guessing that's in a different thread and you still haven't realized that your on another tab or whatever.

Last edited by Hendronicus; 12-03-2009 at 01:58 PM. Reason: clarity
 
Old 12-03-2009, 02:16 PM   #7
meetmefar
LQ Newbie
 
Registered: Aug 2005
Distribution: Linspire
Posts: 22

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Hendronicus View Post
The $PATH setting at the end causes the line to recursively reproduce until you run out of environment space.
Hi,

Thank you for the quick response. Without that How could I have the current PATH variable value to be appended?

Thanks,
meetmefar
 
Old 12-03-2009, 02:26 PM   #8
Hendronicus
Member
 
Registered: Feb 2006
Location: Oldsmar, Fl. USA
Distribution: Slackware, Ubuntu
Posts: 176

Rep: Reputation: 50
Put it on the front of the line, I suppose. I'm not sure that I am correct about your problem, but the $PATH thing just kind of jumped out at me. You might be fine with it and it's really the escape for the new line that's the problem. I would be willing to bet it's one of the two.

Last edited by Hendronicus; 12-03-2009 at 02:26 PM. Reason: spelling
 
Old 12-03-2009, 02:37 PM   #9
meetmefar
LQ Newbie
 
Registered: Aug 2005
Distribution: Linspire
Posts: 22

Original Poster
Rep: Reputation: 0
Thank You!

Same error!! Too many arguments

My only question would be that when the $PATH is in a single line as below, it executes successfully. It has the problem only when I use "\" escape for multi line.

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

Thanks,
meetmefar
 
Old 12-03-2009, 05:58 PM   #10
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,425

Rep: Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786Reputation: 2786
I guess that the setenv cmd doesn't understand the newline escape.

Are you using csh; if so, why not bash
http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/

In any case, the simple soln is to just put it all as one line in your startup/login file eg .profile or .bash_profile or .bashrc
 
Old 12-04-2009, 04:53 PM   #11
stevenworr
LQ Newbie
 
Registered: Oct 2008
Posts: 13

Rep: Reputation: 1
The whole thing is messed up. If you're using csh then follow the previous direction on reading the csh whynot.

If you're using a Bourne flavored shell then there is not setenv command.

If you're using csh then you do not set the PATH variable using seternv. Instead you should use

set path = "d1 d2 d3 etc"

and that will set PATH for you to d1:d2:d3:etc

If you're using bash or a Bourne flavored shell (like bash) then you would use

PATH="d1:d2:d3"

but read the docs before you think you know what you're doing.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
setting environment variable madani Linux - Software 5 03-06-2009 01:15 PM
environment variable setting chii-chan Linux - General 5 01-23-2009 08:29 PM
setting environment variable kb_ganesh Ubuntu 3 09-10-2005 02:58 PM
Setting up a environment variable Hiper1 Linux - Newbie 3 03-08-2005 09:43 AM
Setting an environment variable kharris Linux - General 3 10-02-2003 05:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration