LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-26-2005, 05:35 AM   #1
arunsri
Member
 
Registered: Mar 2005
Distribution: Slackware 10.1
Posts: 49

Rep: Reputation: 15
setting env. variables


hi grp i'm using slack 10.1.

1) How do I set environmental variables? setenv does not work.Is there any other method?

2) For setting PATH...do i need to always wdit the /etc/profile?? There is no .bashrc in slack.But, can I create my own .bashrc and like that for every user?
 
Old 03-26-2005, 05:47 AM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
If you're using bash, then to set an environment value:

variable1=value
variable2=value
export variable1 variable2

Bash expects to find a ~/.bashrc and ~/.bash_profile for each user (in addition to using the system /etc/bashrc and /etc/profile files).
 
Old 03-26-2005, 05:48 AM   #3
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,552

Rep: Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872Reputation: 872
1) setenv is C shell syntax, slackware use bash by default (bourne shell) so the syntax is like:
PATH=/usr/bin:/bin:/usr/X11R6/bin
VISUAL=vim

2) yes
 
Old 03-26-2005, 05:49 AM   #4
chbin
Member
 
Registered: Mar 2005
Distribution: slackware-current
Posts: 379

Rep: Reputation: 31
Re: setting env. variables

Quote:
Originally posted by arunsri
hi grp i'm using slack 10.1.

1) How do I set environmental variables? setenv does not work.Is there any other method?

2) For setting PATH...do i need to always wdit the /etc/profile?? There is no .bashrc in slack.But, can I create my own .bashrc and like that for every user?
For temp varaibles, ones that get chucked after you exit that shell instance..

$ export $VAR
if you want to get rid of it without exiting the shell
$ unset VAR

Set PATH only for that shell instance.
$ export PATH=$PATH:/opt/kde

if you forget the $PATH:, then the only thing in you path will be /opt/kde.

play around the echo $WHATEVER. You can see all variable that begin with C by echo $C ... tab.

To set them for ever instance of a shell put them in you /etc/profile..global
or ~/.profilerc only for only a specific user.
 
  


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
cron and shell env variables lt_wentoncha SUSE / openSUSE 5 07-16-2005 01:20 PM
Suse ent 9.0 setting Env variables not staying. suncloud Linux - Enterprise 1 03-13-2005 03:13 AM
Setting perm env. variables for a super user. Tarts Slackware 7 08-02-2003 09:21 PM
setting env variables globally raven Linux - General 6 02-21-2003 08:04 AM
Open GL env.variables UB_KMA Linux - Newbie 1 08-04-2002 05:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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