LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 09-16-2014, 09:52 AM   #1
linuxmantra
Member
 
Registered: Dec 2013
Posts: 113

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, 10:04 AM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,346

Rep: Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552
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, 10: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, 08:48 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,369

Rep: Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753Reputation: 2753
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



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 01:48 PM
Need help with script writing: Storing cmd in variable, print variable, then exe cmds Arodef Programming 3 01-17-2012 12:26 AM
problem while comparing awk field variable with input variable entered using keyboard vinay007 Programming 12 08-23-2011 12: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 12:08 AM

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

All times are GMT -5. The time now is 04:55 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
Open Source Consulting | Domain Registration