LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 04-01-2012, 12:38 PM   #1
chuck1005
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Rep: Reputation: Disabled
Question help a newbie with system wide environmental variables, please


Hi,
I am taking my first Linux class and given the following assignment:

"All users on the system are to have an environmental variable that points to the /usr/local/share_ideas directory. the name of the environmental variable is SPI(for SharePoint Ideas folder). Every user on the system will have this environmental variable, regardless of weather they are on the SharePoint project or not."

I have done Environmental variables in bash and I think it is:
SPI=/usr/local/share_ideas

Then I thought that that would have to be added to /etc/profile, saved and reboot my system.

I did that and with echo $SPI, I get nothing back.

any help or explanation of what I am doing wrong would be helpful.

thanks,

Chuck'
 
Old 04-01-2012, 12:45 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,009

Rep: Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193
I would suggest looking at some of the other variables set either their or in your .bashrc file and see what else you might be required to do for it to take affect.
 
Old 04-01-2012, 01:07 PM   #3
chuck1005
LQ Newbie
 
Registered: Apr 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
do I need to write a script in /etc/profile? Is SPI=/usr/local/share_ideas the correct variable for what is being asked? this entire question seems to have me stumped and not finding much online as crazy as that sounds.

thanks again,

Chuck
 
Old 04-01-2012, 01:22 PM   #4
sysfce2
Member
 
Registered: Jul 2009
Distribution: Slackware
Posts: 116

Rep: Reputation: 50
Code:
export SPI="/usr/local/share_ideas"
 
Old 04-02-2012, 01:08 AM   #5
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,009

Rep: Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193Reputation: 3193
Well it seems sysfce has thrown in the spoiler, but imagine /etc/profile as a script. When you set the variable it only lives inside the script. Therefore, as demonstrated by sysfce,
you need to export it so the environment is made aware of it
 
  


Reply



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
arm-linux system-wide environment variables stulluk Linux - Newbie 2 01-19-2012 03:40 AM
Setting up system wide environment variables gael Linux - Newbie 3 07-03-2009 01:28 PM
Few commands not found after exporting environmental variables in the system narendra1310 Linux - Newbie 3 05-23-2008 07:47 AM
where to put system-wide environment variables otoomet Linux - Software 2 01-07-2008 07:06 AM
System wide Environment variables Steave Linux - General 1 02-08-2002 05:44 PM

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

All times are GMT -5. The time now is 05:20 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