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 04-16-2005, 05:43 AM   #1
bruse
Member
 
Registered: Feb 2005
Location: internet
Distribution: Debian
Posts: 821

Rep: Reputation: 30
please ..help me on variables


hello what is environment variables.

i have to set LAMRSH=ssh permanently..

so how to set this permanently in my system..

this is common for all users or only exist user only..
 
Old 04-16-2005, 05:58 AM   #2
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
depends on your shell, in bash or zsh:

export LAMRSH=ssh

will set the variable ( note that doing it on the command line last for that session only - as soon as you close the terminal or log out it is no longer in effect).

for a more permanent solution, you will have to enter it into either /home/<user>/.bashrc ( you may have to create this one, this one is for the current user only) or add the above line to /etc/profile ( for all users).
 
Old 04-16-2005, 11:13 AM   #3
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
hey __J

can we set the environment block variable with some C program

regards
 
Old 04-16-2005, 04:01 PM   #4
__J
Senior Member
 
Registered: Dec 2004
Distribution: Slackware, ROCK
Posts: 1,973

Rep: Reputation: 46
sorry, but I'm not sure I completely understand what you are asking? do you want to set an environmental variable from a c program ( just any variable) or set a certain variable from c?
 
Old 04-16-2005, 09:30 PM   #5
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
i want to define a new environment variable
 
Old 04-16-2005, 10:50 PM   #6
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
See man 3 setenv ... doing "apropos environment" would have helped you find this answer on your own.
 
Old 04-16-2005, 11:08 PM   #7
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
i have done that
but setenv will have to be run each time to be setup
ho can we permanently create an env. variable

regards
 
Old 04-16-2005, 11:41 PM   #8
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
I'm not sure what you mean ... if you're writing C code, just call setenv at the beginning of your program execution. If you need the environment variable set up in your shell at all times, then put it in your shell startup file (~/.bashrc and ~/.bash_profile if using bash).
 
Old 04-16-2005, 11:57 PM   #9
masand
LQ Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
yes i have been doing that
setenv and outenv are used for changing the values of define env variables
can i use them to create new env variables??

i am on ubuntu and i do not have this utility here so i cannot check and tell u that right now....

regards
 
  


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
variables? Soulful93 Programming 7 06-13-2004 12:24 AM
variables jpostma Linux - General 4 05-07-2004 12:26 PM
Shel scripting: variables pointing to variables and case Dark_Helmet Programming 5 06-08-2003 11:07 AM
variables granny Linux - Newbie 2 02-12-2003 04:36 PM
Variables hubabuba Linux - Software 1 05-17-2002 11:48 AM


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