LinuxQuestions.org
Visit Jeremy's Blog.
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 08-29-2012, 09:06 PM   #1
wolf2600
LQ Newbie
 
Registered: Nov 2010
Distribution: Slackware
Posts: 29

Rep: Reputation: 1
Easy question: How to add/modify the path?


You know, when you do 'which something', and get 'no something in yadda, yadda, yadda'.

How do I add additional directories to be searched in that yadda?

Slack 13.1.

Thanks.
 
Old 08-29-2012, 09:12 PM   #2
wolf2600
LQ Newbie
 
Registered: Nov 2010
Distribution: Slackware
Posts: 29

Original Poster
Rep: Reputation: 1
Tried the answer I found in Google:

PATH=$PATH:/usr/local/rvm/bin

But that didn't seem to do it.

Last edited by wolf2600; 08-29-2012 at 09:16 PM.
 
Old 08-29-2012, 09:21 PM   #3
abrinister
Member
 
Registered: Dec 2010
Location: /home
Distribution: RL: Arch x64 VM: Debian
Posts: 460

Rep: Reputation: 38
On the command line you need to do:

Code:
export PATH=$PATH:<whatever>
If you don't want to do this every time, I suggest you add that command to your .bashrc.

Alex Brinister
 
Old 08-29-2012, 09:25 PM   #4
wolf2600
LQ Newbie
 
Registered: Nov 2010
Distribution: Slackware
Posts: 29

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by abrinister View Post
On the command line you need to do:

Code:
export PATH=$PATH:<whatever>
If you don't want to do this every time, I suggest you add that command to your .bashrc.

Alex Brinister
Don't hate me..... where might I find .bashrc?
 
Old 08-29-2012, 09:27 PM   #5
abrinister
Member
 
Registered: Dec 2010
Location: /home
Distribution: RL: Arch x64 VM: Debian
Posts: 460

Rep: Reputation: 38
There is one in your home dir and in /etc/bash.bashrc. I would recommend only editing your own unless you want it system-wide.

Alex Brinister
 
Old 08-29-2012, 09:31 PM   #6
wolf2600
LQ Newbie
 
Registered: Nov 2010
Distribution: Slackware
Posts: 29

Original Poster
Rep: Reputation: 1
If I'm logged in as root, should I have a .bashrc in my ~?

And if one isn't there (I did an 'ls -a', and the only bash thing is .bash-history).

Am I missing something, or can I just create the .bashrc file with just the export line?
 
Old 08-29-2012, 09:36 PM   #7
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,251

Rep: Reputation: 630Reputation: 630Reputation: 630Reputation: 630Reputation: 630Reputation: 630
You can just create the file. It does not exist by default in Slackware but it will work if available. I may be mistaken but I don't think /etc/bashrc (or /etc/bash.bashrc) will work system-wide, since that is not a bash feature (most distros ship a .bashrc in /etc/skel that references /etc/bashrc that gets copied to a new user's home directory).
 
Old 08-29-2012, 09:38 PM   #8
abrinister
Member
 
Registered: Dec 2010
Location: /home
Distribution: RL: Arch x64 VM: Debian
Posts: 460

Rep: Reputation: 38
Really? I'm running Arch:

Code:
[fluffypony@0xffeDAEMONPAWNY1969 ~]$ ls /etc/ | grep bash
bash.bash_logout
bash.bashrc
Code:
[fluffypony@0xffeDAEMONPAWNY1969 ~]$ cat /etc/bash.bashrc     
#
# /etc/bash.bashrc
#

# If not running interactively, don't do anything
[[ $- != *i* ]] && return

PS1='[\u@\h \W]\$ '
PS2='> '
PS3='> '
PS4='+ '

case ${TERM} in
  xterm*|rxvt*|Eterm|aterm|kterm|gnome*)
    PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
                                                        
    ;;
  screen)
    PROMPT_COMMAND=${PROMPT_COMMAND:+$PROMPT_COMMAND; }'printf "\033_%s@%s:%s\033\\" "${USER}" "${HOSTNAME%%.*}" "${PWD/#$HOME/~}"'
    ;;
esac

[ -r /usr/share/bash-completion/bash_completion   ] && . /usr/share/bash-completion/bash_completion
Code:
[fluffypony@0xffeDAEMONPAWNY1969 ~]$ cat ./.bashrc 
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

# User specific aliases and functions

export TZ='EST+4'
#xscreensaver &

export PERL_LOCAL_LIB_ROOT="/home/fluffypony/perl5";
export PERL_MB_OPT="--install_base /home/fluffypony/perl5";
export PERL_MM_OPT="INSTALL_BASE=/home/fluffypony/perl5";
export PERL5LIB="/home/fluffypony/perl5/lib/perl5/x86_64-linux-thread-multi:/home/fluffypony/perl5/lib/perl5";
export PATH="/home/fluffypony/perl5/bin:$PATH";

export PERL_LOCAL_LIB_ROOT="/home/fluffypony/perl5";
export PERL_MB_OPT="--install_base /home/fluffypony/perl5";
export PERL_MM_OPT="INSTALL_BASE=/home/fluffypony/perl5";
export PERL5LIB="/home/fluffypony/perl5/lib/perl5/x86_64-linux-thread-multi:/home/fluffypony/perl5/lib/perl5";
export PATH="/home/fluffypony/perl5/bin:$PATH";
Maybe Arch is special...

Alex Brinister

Last edited by abrinister; 08-29-2012 at 09:40 PM.
 
Old 08-29-2012, 09:55 PM   #9
NeoMetal
Member
 
Registered: Aug 2004
Location: MD
Distribution: Slackware
Posts: 105

Rep: Reputation: 19
^ He's not saying the file isn't there, but that isn't typically run for every bash instance on the system, but used as a template for new user accounts initial bashrc if there is one.

Or that was what I understood from it

edit: nvm, didn't read the above closely enough

Last edited by NeoMetal; 08-30-2012 at 12:14 AM.
 
Old 08-29-2012, 09:56 PM   #10
wolf2600
LQ Newbie
 
Registered: Nov 2010
Distribution: Slackware
Posts: 29

Original Poster
Rep: Reputation: 1
http://forums.offtopic.com/images/smilies/wavey.gif

Thanks!



edit: aww c'mon, what kind of a board doesn't allow img code???
 
Old 08-29-2012, 10:28 PM   #11
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,251

Rep: Reputation: 630Reputation: 630Reputation: 630Reputation: 630Reputation: 630Reputation: 630
Quote:
Originally Posted by abrinister View Post
Really? I'm running Arch:
...
Maybe Arch is special...
https://wiki.archlinux.org/index.php..._file_overview

It is non-standard. Arch adds a (non-standard) system bashrc at compile-time:
Code:
  _bashconfig=(-DDEFAULT_PATH_VALUE=\'\"/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin\"\'
               -DSTANDARD_UTILS_PATH=\'\"/usr/bin:/bin:/usr/sbin:/sbin\"\'
               -DSYS_BASHRC=\'\"/etc/bash.bashrc\"\'
               -DSYS_BASH_LOGOUT=\'\"/etc/bash.bash_logout\"\')
Slackware leaves it as the default value (which does not specify a system bashrc).
 
Old 08-29-2012, 10:28 PM   #12
abrinister
Member
 
Registered: Dec 2010
Location: /home
Distribution: RL: Arch x64 VM: Debian
Posts: 460

Rep: Reputation: 38
I see. Thanks!

Getting back on topic, reading this page I realize the difference between bashrc and bash_profile. I would try both to see what suits you.

Alex Brinister

Last edited by abrinister; 08-29-2012 at 10:29 PM.
 
Old 08-29-2012, 10:49 PM   #13
Didier Spaier
Senior Member
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slackware{,64}-{14.1,current} on a Lenovo Thinkpad T61 6457-4XG
Posts: 4,177

Rep: Reputation: 1018Reputation: 1018Reputation: 1018Reputation: 1018Reputation: 1018Reputation: 1018Reputation: 1018Reputation: 1018
Lightbulb

Quote:
Originally Posted by wolf2600 View Post
edit: aww c'mon, what kind of a board doesn't allow img code???
This one does. Just click "Go Advanced" instead of "Post Quick Reply". You will be able to add one emoticon globally and others in the message body.
 
  


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
How to add user's PATH variable (not easy) g_paschoal Programming 8 10-22-2011 12:37 PM
(Easy Question) add to Sudo nathanhillinbl Linux - Software 3 05-06-2007 10:38 PM
Do you add to the path line or make a new path in /etc/profile? M$ISBS Linux - Newbie 2 12-13-2006 02:14 PM
How to modify the library path variable?modify the Electronkz Linux - Newbie 1 04-13-2004 06:18 AM


All times are GMT -5. The time now is 10:01 AM.

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