LinuxQuestions.org
Help answer threads with 0 replies.
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: 326Reputation: 326Reputation: 326Reputation: 326
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
Senior Member
 
Registered: Mar 2004
Distribution: Slackware
Posts: 4,328

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


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
cron and shell env variables lt_wentoncha Suse/Novell 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


All times are GMT -5. The time now is 01:06 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration