LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 02-04-2012, 11:21 AM   #1
neoserdes
Member
 
Registered: Feb 2012
Posts: 35

Rep: Reputation: Disabled
Defined "Undefined variable"


Hi,

I got a really weird issue of environment variable.

When I execute the software, it complained about one variable is not defined. However, when I echo this variable right after, it appears defined well.

What is going wrong there? I'm using rhel 5.6 without subscription.

Regards,
Neo

=====================================
Warning: environment variable SW_SX_COMMON is not defined.

%echo $SW_SX_COMMON
/eda/tool

=====================================
 
Old 02-04-2012, 11:25 AM   #2
millgates
Member
 
Registered: Feb 2009
Location: 192.168.x.x
Distribution: Slackware
Posts: 332

Rep: Reputation: 118Reputation: 118
is the variable exported? like by running
Code:
export SW_SX_COMMON
before you run the program
 
Old 02-04-2012, 11:26 AM   #3
neoserdes
Member
 
Registered: Feb 2012
Posts: 35

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by millgates View Post
is the variable exported? like by running
Code:
export SW_SX_COMMON
before you run the program
What I got is:

%export SW_SX_COMMON
export: Command not found.
 
Old 02-04-2012, 11:27 AM   #4
millgates
Member
 
Registered: Feb 2009
Location: 192.168.x.x
Distribution: Slackware
Posts: 332

Rep: Reputation: 118Reputation: 118
what shell do you use?
 
Old 02-04-2012, 11:32 AM   #5
neoserdes
Member
 
Registered: Feb 2012
Posts: 35

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by millgates View Post
what shell do you use?
i'm using tcsh, thanks.
 
Old 02-04-2012, 11:41 AM   #6
millgates
Member
 
Registered: Feb 2009
Location: 192.168.x.x
Distribution: Slackware
Posts: 332

Rep: Reputation: 118Reputation: 118
oh. In that case, try

Code:
setenv SW_SX_COMMON "/eda/tool"
 
Old 02-04-2012, 12:00 PM   #7
neoserdes
Member
 
Registered: Feb 2012
Posts: 35

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by millgates View Post
oh. In that case, try

Code:
setenv SW_SX_COMMON "/eda/tool"
I did put this in .cshrc and also executed on the command line. However, it is still the same.

Code:
setenv SW_SX_COMMON "/eda/sx_a2008_03-SP1"
PHP Code:
 %echo $SW_SX_COMMON
/eda/tools 

I'm confused. Thanks.
 
Old 02-04-2012, 12:17 PM   #8
millgates
Member
 
Registered: Feb 2009
Location: 192.168.x.x
Distribution: Slackware
Posts: 332

Rep: Reputation: 118Reputation: 118
That's strange. What is the software you are trying to run?
 
Old 02-04-2012, 02:26 PM   #9
neoserdes
Member
 
Registered: Feb 2012
Posts: 35

Original Poster
Rep: Reputation: Disabled
It is an EDA software. Sandword waveviewer.

Anyway, it doesn't stop me from using it. Let go so far.
 
Old 02-05-2012, 07:28 PM   #10
chrism01
Guru
 
Registered: Aug 2004
Location: Brisbane
Distribution: Centos 6.2, Centos 5.8
Posts: 11,740

Rep: Reputation: 905Reputation: 905Reputation: 905Reputation: 905Reputation: 905Reputation: 905Reputation: 905Reputation: 905
Sounds like its not being exported to appear in any sub-shells created during the run of the SW.
Defining the var means it only appears in the current shell.
Don't know the syntax for exporting a var in the *csh shells, but I'm sure you do
 
1 members found this post helpful.
Old 02-06-2012, 01:35 PM   #11
neoserdes
Member
 
Registered: Feb 2012
Posts: 35

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by chrism01 View Post
Sounds like its not being exported to appear in any sub-shells created during the run of the SW.
Defining the var means it only appears in the current shell.
Don't know the syntax for exporting a var in the *csh shells, but I'm sure you do
I already used

Code:
setenv XXX "YYY"
But it doesn't seem to pass down?
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Where is the variable "always_inline" defined? minivy Linux - Software 1 12-08-2011 05:29 AM
Cannot start Tomcat and get "The BASEDIR environment variable is not defined correctl thomas2004ch Linux - Software 1 07-14-2010 05:07 AM
How to get the "data type" of an "unknown variable" in "C Language" ? Affair Programming 8 06-20-2009 12:30 PM
Script issue with "Undefined variable" fuske Linux - General 3 05-19-2009 09:41 AM
"Multiple definition of" and "undefined reference to" in QT Creator with QJson lib echelon89 Programming 1 05-01-2009 06:48 AM


All times are GMT -5. The time now is 02:45 AM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration