LinuxQuestions.org
Visit Jeremy's Blog.
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 09-16-2014, 10:52 AM   #1
linuxmantra
Member
 
Registered: Dec 2013
Posts: 104

Rep: Reputation: Disabled
Environemental Variable


Recently I got a ticket in which they want to setup environmental variable as:
Environment variables:
znenv: DEV
znqtp: CGP
zbnnode: 02
znrole: RD

Server is running RHEL6.4 and ticket suggested to create a zmp.sh file and put in /etc/profile.d/. doing little research in google and created following lines in zmp.sh as:
export ZN_ENVIRONMENT="DEV";
export ZN_NODE="02";
export ZN_ROLE="RD";
export ZN_QTP="CGP";

Can any one tell me, have I done the job correctly in above lines?
 
Old 09-16-2014, 11:04 AM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,750

Rep: Reputation: 271Reputation: 271Reputation: 271
You can check to see if your export commands worked by displaying the variables:

echo $ZN_ENVIRONMENT
echo $ZN_NODE
echo $ZN_ROLE
echo $ZN_QTP


----------------------
Steve Stites
 
Old 09-16-2014, 11:05 AM   #3
vijay.kanta
LQ Newbie
 
Registered: Sep 2013
Posts: 10

Rep: Reputation: Disabled
Did you try the ~/.bashrc file? Correct me if I am wrong, you can write those "export" commands in that file and don't have to worry about them going away..
 
Old 09-16-2014, 09:48 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
After setting as suggested in the ticket, you'll need to logout and back in, as that location will cause them to be set for every user that logs in.
If you only want a specific user to get them (likely), then add to the appropriate .bashrc as suggested.
 
  


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
[SOLVED] ksh read variable from text file and populate with content of shell variable WindozBytes Programming 4 09-17-2012 02:48 PM
Need help with script writing: Storing cmd in variable, print variable, then exe cmds Arodef Programming 3 01-17-2012 01:26 AM
problem while comparing awk field variable with input variable entered using keyboard vinay007 Programming 12 08-23-2011 01:44 AM
AWK a variable Ouptut to a new variable and using the new variable with the old one alertroshannow Linux - Newbie 4 02-16-2009 01:08 AM


All times are GMT -5. The time now is 02:37 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration